tools/sched_ext/scx_sdt.c

Source file repositories/reference/linux-study-clean/tools/sched_ext/scx_sdt.c

File Facts

System
Linux kernel
Corpus path
tools/sched_ext/scx_sdt.c
Extension
.c
Size
2644 bytes
Lines
103
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

switch (opt) {
		case 'v':
			verbose = true;
			break;
		default:
			fprintf(stderr, help_fmt, basename(argv[0]));
			return opt != 'h';
		}
	}

	SCX_OPS_LOAD(skel, sdt_ops, scx_sdt, uei);
	link = SCX_OPS_ATTACH(skel, sdt_ops, scx_sdt);

	while (!exit_req && !UEI_EXITED(skel, uei)) {
		printf("====SCHEDULING STATS====\n");
		printf("enqueues=%llu\t", skel->bss->stat_enqueue);
		printf("inits=%llu\t", skel->bss->stat_init);
		printf("exits=%llu\t", skel->bss->stat_exit);
		printf("\n");

		printf("select_idle_cpu=%llu\t", skel->bss->stat_select_idle_cpu);
		printf("select_busy_cpu=%llu\t", skel->bss->stat_select_busy_cpu);
		printf("\n");

		printf("====ALLOCATION STATS====\n");
		printf("chunk allocs=%llu\t", skel->bss->alloc_stats.chunk_allocs);
		printf("data_allocs=%llu\n", skel->bss->alloc_stats.data_allocs);
		printf("alloc_ops=%llu\t", skel->bss->alloc_stats.alloc_ops);
		printf("free_ops=%llu\t", skel->bss->alloc_stats.free_ops);
		printf("active_allocs=%llu\t", skel->bss->alloc_stats.active_allocs);
		printf("arena_pages_used=%llu\t", skel->bss->alloc_stats.arena_pages_used);
		printf("\n\n");

		fflush(stdout);
		sleep(1);
	}

	bpf_link__destroy(link);
	ecode = UEI_REPORT(skel, uei);
	scx_sdt__destroy(skel);

	if (UEI_ECODE_RESTART(ecode))
		goto restart;
	return 0;
}

Annotation

Implementation Notes