lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_1C233A1BC00A0164C55FCAAB24BF768C320A@qq.com>
Date:   Mon, 26 Sep 2022 10:22:42 +0800
From:   Rong Tao <rtoax@...mail.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     Rong Tao <rongtao@...tc.cn>, Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <martin.lau@...ux.dev>,
        Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>,
        Stanislav Fomichev <sdf@...gle.com>,
        Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
        bpf@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH bpf-next] samples/bpf: offwaketime: pretty print

From: Rong Tao <rongtao@...tc.cn>

A sample of call stack:
swapper/10 [
	secondary_startup_64_no_verify
	cpu_startup_entry
	do_idle
	schedule_idle
	__schedule
	__traceiter_sched_switch
	__traceiter_sched_switch
	-
	try_to_wake_up
	call_timer_fn
	__run_timers.part.0
	run_timer_softirq
	__softirqentry_text_start
	__irq_exit_rcu
	sysvec_apic_timer_interrupt
	asm_sysvec_apic_timer_interrupt
	cpuidle_enter_state
	cpuidle_enter
	cpuidle_idle_call
	do_idle
	cpu_startup_entry
	secondary_startup_64_no_verify
] swapper/10 1

Signed-off-by: Rong Tao <rongtao@...tc.cn>
---
 samples/bpf/offwaketime_user.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/samples/bpf/offwaketime_user.c b/samples/bpf/offwaketime_user.c
index b6eedcb98fb9..d89278d62e4e 100644
--- a/samples/bpf/offwaketime_user.c
+++ b/samples/bpf/offwaketime_user.c
@@ -30,9 +30,9 @@ static void print_ksym(__u64 addr)
 	}
 
 	if (PRINT_RAW_ADDR)
-		printf("%s/%llx;", sym->name, addr);
+		printf("\t%s/%llx\n", sym->name, addr);
 	else
-		printf("%s;", sym->name);
+		printf("\t%s\n", sym->name);
 }
 
 #define TASK_COMM_LEN 16
@@ -50,21 +50,21 @@ static void print_stack(struct key_t *key, __u64 count)
 	static bool warned;
 	int i;
 
-	printf("%s;", key->target);
+	printf("%s [\n", key->target);
 	if (bpf_map_lookup_elem(map_fd[1], &key->tret, ip) != 0) {
-		printf("---;");
+		printf("\t---\n");
 	} else {
 		for (i = PERF_MAX_STACK_DEPTH - 1; i >= 0; i--)
 			print_ksym(ip[i]);
 	}
-	printf("-;");
+	printf("\t-\n");
 	if (bpf_map_lookup_elem(map_fd[1], &key->wret, ip) != 0) {
-		printf("---;");
+		printf("\t---\n");
 	} else {
 		for (i = 0; i < PERF_MAX_STACK_DEPTH; i++)
 			print_ksym(ip[i]);
 	}
-	printf(";%s %lld\n", key->waker, count);
+	printf("] %s %lld\n", key->waker, count);
 
 	if ((key->tret == -EEXIST || key->wret == -EEXIST) && !warned) {
 		printf("stackmap collisions seen. Consider increasing size\n");
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ