tools/lib/api/fs/tracing_path.c
Source file repositories/reference/linux-study-clean/tools/lib/api/fs/tracing_path.c
File Facts
- System
- Linux kernel
- Corpus path
tools/lib/api/fs/tracing_path.c- Extension
.c- Size
- 3598 bytes
- Lines
- 179
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdio.hstdlib.hstring.hlinux/string.herrno.hunistd.hfs.htracing_path.h
Detected Declarations
function __tracing_path_setfunction tracing_path_setfunction put_tracing_filefunction put_events_filefunction tracing_events__scandir_alphasortfunction tracing_path__strerror_open_tp
Annotated Snippet
if (debugfs__configured() || tracefs__configured()) {
/* sdt markers */
if (!strncmp(filename, "sdt_", 4)) {
snprintf(buf, size,
"Error:\tFile %s/events/%s not found.\n"
"Hint:\tSDT event cannot be directly recorded on.\n"
"\tPlease first use 'perf probe %s:%s' before recording it.\n",
tracing_path, filename, sys, name);
} else {
snprintf(buf, size,
"Error:\tFile %s/events/%s not found.\n"
"Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n",
tracing_path, filename);
}
break;
}
snprintf(buf, size, "%s",
"Error:\tUnable to find debugfs/tracefs\n"
"Hint:\tWas your kernel compiled with debugfs/tracefs support?\n"
"Hint:\tIs the debugfs/tracefs filesystem mounted?\n"
"Hint:\tTry 'sudo mount -t debugfs nodev /sys/kernel/debug'");
break;
case EACCES: {
snprintf(buf, size,
"Error:\tNo permissions to read %s/events/%s\n"
"Hint:\tTry 'sudo mount -o remount,mode=755 %s'\n",
tracing_path, filename, tracing_path_mount());
}
break;
default:
snprintf(buf, size, "%s", str_error_r(err, sbuf, sizeof(sbuf)));
break;
}
return 0;
}
Annotation
- Immediate include surface: `stdio.h`, `stdlib.h`, `string.h`, `linux/string.h`, `errno.h`, `unistd.h`, `fs.h`, `tracing_path.h`.
- Detected declarations: `function __tracing_path_set`, `function tracing_path_set`, `function put_tracing_file`, `function put_events_file`, `function tracing_events__scandir_alphasort`, `function tracing_path__strerror_open_tp`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.