mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Swapnil Sapkal <swapnil.sapkal@amd.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: <peterz@infradead.org>, <mingo@redhat.com>, <acme@kernel.org>,
	<irogers@google.com>, <james.clark@arm.com>,
	<ravi.bangoria@amd.com>, <yu.c.chen@intel.com>,
	<mark.rutland@arm.com>, <alexander.shishkin@linux.intel.com>,
	<jolsa@kernel.org>, <rostedt@goodmis.org>,
	<vincent.guittot@linaro.org>, <adrian.hunter@intel.com>,
	<kan.liang@linux.intel.com>, <gautham.shenoy@amd.com>,
	<kprateek.nayak@amd.com>, <juri.lelli@redhat.com>,
	<yangjihong@bytedance.com>, <void@manifault.com>, <tj@kernel.org>,
	<sshegde@linux.ibm.com>, <ctshao@google.com>,
	<quic_zhonhan@quicinc.com>, <thomas.falcon@intel.com>,
	<blakejones@google.com>, <ashelat@redhat.com>, <leo.yan@arm.com>,
	<dvyukov@google.com>, <ak@linux.intel.com>, <yujie.liu@intel.com>,
	<graham.woodward@arm.com>, <ben.gainey@arm.com>,
	<vineethr@linux.ibm.com>, <tim.c.chen@linux.intel.com>,
	<linux@treblig.org>, <linux-kernel@vger.kernel.org>,
	<linux-perf-users@vger.kernel.org>, <santosh.shukla@amd.com>,
	<sandipan.das@amd.com>
Subject: Re: [PATCH RESEND v4 01/11] perf: Add print_separator to util
Date: Fri, 9 Jan 2026 16:53:42 +0530	[thread overview]
Message-ID: <79489188-ba79-4f98-bca5-6c64c5f13b38@amd.com> (raw)
In-Reply-To: <aVhC40oJIx1cbfiJ@google.com>

Hello Namhyung,

On 03-01-2026 03:42, Namhyung Kim wrote:
> Hello,
> 
> Sorry for the delay and happy new year!
> 

No worries at all. Happy new year to you too!

> On Tue, Sep 09, 2025 at 11:42:17AM +0000, Swapnil Sapkal wrote:
>> Add print_separator to util.c and use it wherever necessary.
>>
>> Signed-off-by: Swapnil Sapkal <swapnil.sapkal@amd.com>
>> ---
>>   tools/perf/builtin-kwork.c | 13 ++++---------
>>   tools/perf/util/util.c     |  6 ++++++
>>   tools/perf/util/util.h     |  2 ++
>>   3 files changed, 12 insertions(+), 9 deletions(-)
>>
>> diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c
>> index d2e08de5976d..842f59ff85ac 100644
>> --- a/tools/perf/builtin-kwork.c
>> +++ b/tools/perf/builtin-kwork.c
>> @@ -1340,11 +1340,6 @@ static struct kwork_class *kwork_class_supported_list[KWORK_CLASS_MAX] = {
>>   	[KWORK_CLASS_SCHED]     = &kwork_sched,
>>   };
>>   
>> -static void print_separator(int len)
>> -{
>> -	printf(" %.*s\n", len, graph_dotted_line);
>> -}
>> -
>>   static int report_print_work(struct perf_kwork *kwork, struct kwork_work *work)
>>   {
>>   	int ret = 0;
>> @@ -1458,7 +1453,7 @@ static int report_print_header(struct perf_kwork *kwork)
>>   	}
>>   
>>   	printf("\n");
>> -	print_separator(ret);
>> +	print_separator(ret, "", 0);
>>   	return ret;
>>   }
>>   
>> @@ -1633,7 +1628,7 @@ static void top_print_header(struct perf_kwork *kwork __maybe_unused)
>>   		     PRINT_RUNTIME_HEADER_WIDTH + RPINT_DECIMAL_WIDTH, "RUNTIME",
>>   		     PRINT_TASK_NAME_WIDTH, "COMMAND");
>>   	printf("\n ");
>> -	print_separator(ret);
>> +	print_separator(ret, "", 0);
>>   }
>>   
>>   static int top_print_work(struct perf_kwork *kwork __maybe_unused, struct kwork_work *work)
>> @@ -1933,11 +1928,11 @@ static int perf_kwork__report(struct perf_kwork *kwork)
>>   		}
>>   		next = rb_next(next);
>>   	}
>> -	print_separator(ret);
>> +	print_separator(ret, "", 0);
>>   
>>   	if (kwork->summary) {
>>   		print_summary(kwork);
>> -		print_separator(ret);
>> +		print_separator(ret, "", 0);
>>   	}
>>   
>>   	print_bad_events(kwork);
>> diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
>> index 0f031eb80b4c..1b91834e11de 100644
>> --- a/tools/perf/util/util.c
>> +++ b/tools/perf/util/util.c
>> @@ -257,6 +257,12 @@ static int rm_rf_kcore_dir(const char *path)
>>   	return 0;
>>   }
>>   
>> +void print_separator(int pre_dash_cnt, const char *s, int post_dash_cnt)
>> +{
>> +	printf("%.*s%s%.*s\n", pre_dash_cnt, graph_dotted_line, s, post_dash_cnt,
>> +	       graph_dotted_line);
>> +}
> 
> I think it's better to keep the existing interface and add a new one
> like print_separator2() for your case.  The old one can be implemented
> on top of the new API.
> 

Sure, I will update this in the next version.

--
Thanks and Regards,
Swapnil

> Thanks,
> Namhyung
> 
>> +
>>   int rm_rf_perf_data(const char *path)
>>   {
>>   	const char *pat[] = {
>> diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
>> index 3423778e39a5..de69384380c2 100644
>> --- a/tools/perf/util/util.h
>> +++ b/tools/perf/util/util.h
>> @@ -48,6 +48,8 @@ bool sysctl__nmi_watchdog_enabled(void);
>>   
>>   int perf_tip(char **strp, const char *dirpath);
>>   
>> +void print_separator(int pre_dash_cnt, const char *s, int post_dash_cnt);
>> +
>>   #ifndef HAVE_SCHED_GETCPU_SUPPORT
>>   int sched_getcpu(void);
>>   #endif
>> -- 
>> 2.43.0
>>


  reply	other threads:[~2026-01-09 11:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09 11:42 [PATCH RESEND v4 00/11] perf sched: Introduce stats tool Swapnil Sapkal
2025-09-09 11:42 ` [PATCH RESEND v4 01/11] perf: Add print_separator to util Swapnil Sapkal
2026-01-02 22:12   ` Namhyung Kim
2026-01-09 11:23     ` Swapnil Sapkal [this message]
2025-09-09 11:42 ` [PATCH RESEND v4 02/11] tools/lib: Add list_is_first() Swapnil Sapkal
2025-09-09 11:42 ` [PATCH RESEND v4 03/11] perf header: Support CPU DOMAIN relation info Swapnil Sapkal
2025-09-17  6:20   ` kernel test robot
2026-01-02 22:26   ` Namhyung Kim
2026-01-09 11:24     ` Swapnil Sapkal
2026-01-19 18:11       ` Swapnil Sapkal
2025-09-09 11:42 ` [PATCH RESEND v4 04/11] perf sched stats: Add record and rawdump support Swapnil Sapkal
2025-09-09 11:42 ` [PATCH RESEND v4 05/11] perf sched stats: Add schedstat v16 support Swapnil Sapkal
2026-01-02 22:28   ` Namhyung Kim
2026-01-09 11:24     ` Swapnil Sapkal
2025-09-09 11:42 ` [PATCH RESEND v4 06/11] perf sched stats: Add schedstat v17 support Swapnil Sapkal
2025-09-09 11:42 ` [PATCH RESEND v4 07/11] perf sched stats: Add support for report subcommand Swapnil Sapkal
2026-01-02 22:35   ` Namhyung Kim
2026-01-09 11:25     ` Swapnil Sapkal
2026-01-19 18:35       ` Swapnil Sapkal
2025-09-09 11:42 ` [PATCH RESEND v4 08/11] perf sched stats: Add support for live mode Swapnil Sapkal
2025-09-09 11:42 ` [PATCH RESEND v4 09/11] perf sched stats: Add support for diff subcommand Swapnil Sapkal
2025-09-09 11:42 ` [PATCH RESEND v4 10/11] perf sched stats: Add basic perf sched stats test Swapnil Sapkal
2025-09-09 11:42 ` [PATCH RESEND v4 11/11] perf sched stats: Add details in man page Swapnil Sapkal

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=79489188-ba79-4f98-bca5-6c64c5f13b38@amd.com \
    --to=swapnil.sapkal@amd.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ashelat@redhat.com \
    --cc=ben.gainey@arm.com \
    --cc=blakejones@google.com \
    --cc=ctshao@google.com \
    --cc=dvyukov@google.com \
    --cc=gautham.shenoy@amd.com \
    --cc=graham.woodward@arm.com \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=juri.lelli@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=kprateek.nayak@amd.com \
    --cc=leo.yan@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux@treblig.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=quic_zhonhan@quicinc.com \
    --cc=ravi.bangoria@amd.com \
    --cc=rostedt@goodmis.org \
    --cc=sandipan.das@amd.com \
    --cc=santosh.shukla@amd.com \
    --cc=sshegde@linux.ibm.com \
    --cc=thomas.falcon@intel.com \
    --cc=tim.c.chen@linux.intel.com \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vineethr@linux.ibm.com \
    --cc=void@manifault.com \
    --cc=yangjihong@bytedance.com \
    --cc=yu.c.chen@intel.com \
    --cc=yujie.liu@intel.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®