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.

Dependency Surface

Detected Declarations

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

Implementation Notes