From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40056C6FA93 for ; Tue, 27 Sep 2022 23:38:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231761AbiI0XiE (ORCPT ); Tue, 27 Sep 2022 19:38:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229616AbiI0XiA (ORCPT ); Tue, 27 Sep 2022 19:38:00 -0400 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F166E1D1E1A; Tue, 27 Sep 2022 16:37:58 -0700 (PDT) Message-ID: <1d2c81e7-b9d8-c153-608b-6464a10949d8@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1664321877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NJ7/GjwO5s3/ginJgteWz0r6uzF1YuNFPNCQEpTVgMU=; b=Iqz19tkvvyFkJkeNoOree+vsCZ3s93kTzq11StWbOi+2u4ykiHzzr2Ff2tyNkEXkZzSS6T ILdIyDrV4NIuIVIHq2A2TN1zWTJJhPtUnDvJDHLOAE04mV8CnXTeBq5fNKaNfYUdSPa+Lf NjRfUeE80YHt/WpwzJGePdOxc//7ITs= Date: Tue, 27 Sep 2022 16:37:44 -0700 MIME-Version: 1.0 Subject: Re: [PATCH bpf-next] samples/bpf: offwaketime: pretty print Content-Language: en-US To: Rong Tao Cc: Rong Tao , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf@vger.kernel.org, linux-kernel@vger.kernel.org References: X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/25/22 7:22 PM, Rong Tao wrote: > From: Rong Tao > > 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 > --- > 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.