-
- return __kdebug_trace64(code, arg1, arg2, arg3, arg4);
+
+ if ((err = kdebug_validate_debugid(debugid)) != 0) {
+ errno = err;
+ return -1;
+ }
+
+ return __kdebug_trace64(debugid, arg1, arg2, arg3, arg4);
+}
+
+uint64_t
+kdebug_trace_string(uint32_t debugid, uint64_t str_id, const char *str)
+{
+ int err;
+
+ if (!kdebug_enabled()) {
+ return 0;
+ }
+
+ if ((int64_t)str_id == -1) {
+ errno = EINVAL;
+ return (uint64_t)-1;
+ }
+
+ if (str_id == 0 && str == NULL) {
+ errno = EINVAL;
+ return (uint64_t)-1;
+ }
+
+ if ((err = kdebug_validate_debugid(debugid)) != 0) {
+ errno = err;
+ return (uint64_t)-1;
+ }
+
+ return __kdebug_trace_string(debugid, str_id, str);