tools/perf/util/bpf_skel/bpf_prog_profiler.bpf.c

Source file repositories/reference/linux-study-clean/tools/perf/util/bpf_skel/bpf_prog_profiler.bpf.c

File Facts

System
Linux kernel
Corpus path
tools/perf/util/bpf_skel/bpf_prog_profiler.bpf.c
Extension
.c
Size
2290 bytes
Lines
93
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.

Dependency Surface

Detected Declarations

Annotated Snippet

if (accum) {
			accum->counter += diff.counter;
			accum->enabled += diff.enabled;
			accum->running += diff.running;
		}
	}
}

SEC("fexit/XXX")
int BPF_PROG(fexit_XXX)
{
	struct bpf_perf_event_value reading;
	__u32 cpu = bpf_get_smp_processor_id();
	int err;

	/* read all events before updating the maps, to reduce error */
	err = bpf_perf_event_read_value(&events, cpu, &reading, sizeof(reading));
	if (err)
		return 0;

	fexit_update_maps(&reading);
	return 0;
}

char LICENSE[] SEC("license") = "Dual BSD/GPL";

Annotation

Implementation Notes