tools/perf/scripts/python/intel-pt-events.py
Source file repositories/reference/linux-study-clean/tools/perf/scripts/python/intel-pt-events.py
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/scripts/python/intel-pt-events.py- Extension
.py- Size
- 14636 bytes
- Lines
- 495
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
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
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
def context_switch(ts, cpu, pid, tid, np_pid, np_tid, machine_pid, out, out_preempt, *x):
if glb_args.interleave:
flush_stashed_output()
if out:
out_str = "Switch out "
else:
out_str = "Switch In "
if out_preempt:
preempt_str = "preempt"
else:
preempt_str = ""
if len(x) >= 2 and x[0]:
machine_pid = x[0]
vcpu = x[1]
else:
vcpu = None;
if machine_pid == -1:
machine_str = ""
elif vcpu is None:
machine_str = "machine PID %d" % machine_pid
else:
machine_str = "machine PID %d VCPU %d" % (machine_pid, vcpu)
switch_str = "%16s %5d/%-5d [%03u] %9u.%09u %5d/%-5d %s %s" % \
(out_str, pid, tid, cpu, ts / 1000000000, ts %1000000000, np_pid, np_tid, machine_str, preempt_str)
if glb_args.all_switch_events:
print(switch_str)
else:
global glb_switch_str
glb_switch_str[cpu] = switch_str
Annotation
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
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.