From: Martin KaFai Lau <martin.lau@linux.dev>
To: Rong Tao <rtoax@foxmail.com>
Cc: Rong Tao <rongtao@cestc.cn>, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>, Song Liu <song@kernel.org>,
Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next] samples/bpf: offwaketime: pretty print
Date: Tue, 27 Sep 2022 16:37:44 -0700 [thread overview]
Message-ID: <1d2c81e7-b9d8-c153-608b-6464a10949d8@linux.dev> (raw)
In-Reply-To: <tencent_1C233A1BC00A0164C55FCAAB24BF768C320A@qq.com>
On 9/25/22 7:22 PM, Rong Tao wrote:
> From: Rong Tao <rongtao@cestc.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@cestc.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);
The origin commit intention is to have an external script for post processing.
Beside, there are bcc, bpftrace, and libbpf-tools which are better places to
have different output options. The current code is good enough for sample
purpose and no need for unnecessary code churn.
next prev parent reply other threads:[~2022-09-27 23:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-26 2:22 Rong Tao
2022-09-27 23:37 ` Martin KaFai Lau [this message]
2022-09-28 1:20 ` Rong Tao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1d2c81e7-b9d8-c153-608b-6464a10949d8@linux.dev \
--to=martin.lau@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rongtao@cestc.cn \
--cc=rtoax@foxmail.com \
--cc=sdf@google.com \
--cc=song@kernel.org \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®