tools/perf/util/powerpc-vpadtl.c
Source file repositories/reference/linux-study-clean/tools/perf/util/powerpc-vpadtl.c
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/powerpc-vpadtl.c- Extension
.c- Size
- 17882 bytes
- Lines
- 737
- 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
linux/string.hlinux/zalloc.herrno.hinttypes.hcolor.hevlist.hsession.hauxtrace.hdata.hmachine.hdebug.hpowerpc-vpadtl.hsample.htool.h
Detected Declarations
struct powerpc_vpadtlstruct boottb_freqstruct powerpc_vpadtl_queuefunction powerpc_vpadtl_dumpfunction powerpc_vpadtl_timestampfunction powerpc_vpadtl_dump_eventfunction perf_sample__fprintf_synthfunction powerpc_vpadtl_get_bufferfunction powerpc_vpadtl_decodefunction powerpc_vpadtl_decode_allfunction powerpc_vpadtl_run_decoderfunction powerpc_vpadtl_process_queuesfunction powerpc_vpadtl__setup_queuefunction powerpc_vpadtl__setup_queuesfunction powerpc_vpadtl__update_queuesfunction powerpc_vpadtl_process_eventfunction powerpc_vpadtl_process_auxtrace_eventfunction powerpc_vpadtl_flushfunction powerpc_vpadtl_free_eventsfunction powerpc_vpadtl_freefunction powerpc_vpadtl_print_infofunction set_event_namefunction evlist__for_each_entryfunction powerpc_vpadtl_synth_eventsfunction evlist__for_each_entryfunction auxtrace_queues__init
Annotated Snippet
struct powerpc_vpadtl {
struct auxtrace auxtrace;
struct auxtrace_queues queues;
struct auxtrace_heap heap;
u32 auxtrace_type;
struct perf_session *session;
struct machine *machine;
u32 pmu_type;
u64 sample_id;
};
struct boottb_freq {
u64 boot_tb;
u64 tb_freq;
u64 timebase;
u64 padded[3];
};
struct powerpc_vpadtl_queue {
struct powerpc_vpadtl *vpa;
unsigned int queue_nr;
struct auxtrace_buffer *buffer;
struct thread *thread;
bool on_heap;
struct powerpc_vpadtl_entry *dtl;
u64 timestamp;
unsigned long pkt_len;
unsigned long buf_len;
u64 boot_tb;
u64 tb_freq;
unsigned int tb_buffer;
unsigned int size;
bool done;
pid_t pid;
pid_t tid;
int cpu;
};
const char *dispatch_reasons[11] = {
"external_interrupt",
"firmware_internal_event",
"H_PROD",
"decrementer_interrupt",
"system_reset",
"firmware_internal_event",
"conferred_cycles",
"time_slice",
"virtual_memory_page_fault",
"expropriated_adjunct",
"priv_doorbell"};
const char *preempt_reasons[10] = {
"unused",
"firmware_internal_event",
"H_CEDE",
"H_CONFER",
"time_slice",
"migration_hibernation_page_fault",
"virtual_memory_page_fault",
"H_CONFER_ADJUNCT",
"hcall_adjunct",
"HDEC_adjunct"};
#define dtl_entry_size sizeof(struct powerpc_vpadtl_entry)
/*
* Function to dump the dispatch trace data when perf report
* is invoked with -D
*/
static void powerpc_vpadtl_dump(struct powerpc_vpadtl *vpa __maybe_unused,
unsigned char *buf, size_t len)
{
struct powerpc_vpadtl_entry *dtl;
int pkt_len, pos = 0;
const char *color = PERF_COLOR_BLUE;
color_fprintf(stdout, color,
". ... VPA DTL PMU data: size %zu bytes, entries is %zu\n",
len, len/dtl_entry_size);
if (len % dtl_entry_size)
len = len - (len % dtl_entry_size);
while (len) {
pkt_len = dtl_entry_size;
printf(".");
color_fprintf(stdout, color, " %08x: ", pos);
dtl = (struct powerpc_vpadtl_entry *)buf;
if (dtl->timebase != 0) {
printf("dispatch_reason:%s, preempt_reason:%s, "
Annotation
- Immediate include surface: `linux/string.h`, `linux/zalloc.h`, `errno.h`, `inttypes.h`, `color.h`, `evlist.h`, `session.h`, `auxtrace.h`.
- Detected declarations: `struct powerpc_vpadtl`, `struct boottb_freq`, `struct powerpc_vpadtl_queue`, `function powerpc_vpadtl_dump`, `function powerpc_vpadtl_timestamp`, `function powerpc_vpadtl_dump_event`, `function perf_sample__fprintf_synth`, `function powerpc_vpadtl_get_buffer`, `function powerpc_vpadtl_decode`, `function powerpc_vpadtl_decode_all`.
- 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.