Received: by 10.223.185.116 with SMTP id b49csp8726444wrg; Fri, 2 Mar 2018 06:59:50 -0800 (PST) X-Google-Smtp-Source: AG47ELuLzomJ9DqT/7L008sHziZVLS7GFy8Ywz6UHlhZI9kjY1uJ3c3i6hOVpeGoNUfZvAa22vUc X-Received: by 2002:a17:902:4545:: with SMTP id m63-v6mr5357797pld.15.1520002790562; Fri, 02 Mar 2018 06:59:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520002790; cv=none; d=google.com; s=arc-20160816; b=pt/qJhly+1Cy5GzOeIjIWqpPwgHTsMDgU1rqstpDMUh9cvXB62afzqzFdBBjXMPi/L OFpWoTq63hDnpl0JrhTROxksBpLjKVJJHVDK9ZMJHS19q5Ey54g6B7RmdBmuiFkfJskw t3LK5VR6spIMVIc3BfGVExkfTQi+K0La7XX2KzE9WYAFKfnye/OMNKlNk9K2CO+Jep9N Cnr0IXF5Lqily0d2zMISseTntfPBd4ezPyP+G/idIkep9hTKZ6sk2Vwa97kSXniJfpnY 0WbvjWHK8go4qtJOTzWfm+7pa0z73eRlnXEEYD5ak75EYJjNIgvKgTJK4FXWCYg5x34w 3H7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Y1PWT4DqyVsTH8GaMEz7/nrf9USsacptqECtcsYgscA=; b=WTHZoqSqTsxq40UE5ZbuV/Nf1RpMMREpTpFBlu9SSF3Qj7WhQdlogVnMk6N0FjsEPQ M7uEofg6QABkjMvFu6V2Y1iknbJNvZ5upl6HSMsy1e65ZcRi4CZn1HI7GLbgQvTwEzzT DpYToq16dMW6ZP0dErSY91+fUy/IrpTIQL/boTjoI2GNGlSHGsajBRKyqedqSjQgxVzh yxl2OjRiqDmMLvimhBKCrySPG96k/L16Vw1ulWgXEgsGRG/AClrvgdtRXo2yP9sDOhzF rZMH7bSYkliuEUU4P4H4QazyTikOeqkeQOfsx28pkraRAXn0bMzPWaVmMX9qKeov2P/H yBvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w22-v6si4853381plq.605.2018.03.02.06.59.35; Fri, 02 Mar 2018 06:59:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426856AbeCBLCk (ORCPT + 99 others); Fri, 2 Mar 2018 06:02:40 -0500 Received: from mga17.intel.com ([192.55.52.151]:1126 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423776AbeCBLBy (ORCPT ); Fri, 2 Mar 2018 06:01:54 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2018 03:01:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,412,1515484800"; d="scan'208";a="208337335" Received: from gvt-dell.bj.intel.com (HELO intel.com) ([10.238.154.59]) by fmsmga006.fm.intel.com with SMTP; 02 Mar 2018 03:01:51 -0800 Date: Fri, 2 Mar 2018 18:52:54 +0800 From: "Du, Changbin" To: acme@kernel.org, jolsa@redhat.com Cc: acme@kernel.org, jolsa@redhat.com, peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [RESEND PATCH] perf sched map: re-annotate shortname if thread comm changed Message-ID: <20180302105254.234axj7b3nixakav@intel.com> References: <1519386040-25874-1-git-send-email-changbin.du@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519386040-25874-1-git-send-email-changbin.du@intel.com> User-Agent: NeoMutt/20171027-42-ad8712 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, any comment? On Fri, Feb 23, 2018 at 07:40:40PM +0800, changbin.du@intel.com wrote: > From: Changbin Du > > This is to show the real name of thread that created via fork-exec. > See below example for shortname *A0*. > > $ sudo ./perf sched map > *A0 80393.050639 secs A0 => perf:22368 > *. A0 80393.050748 secs . => swapper:0 > . *. 80393.050887 secs > *B0 . . 80393.052735 secs B0 => rcu_sched:8 > *. . . 80393.052743 secs > . *C0 . 80393.056264 secs C0 => kworker/2:1H:287 > . *A0 . 80393.056270 secs > . *D0 . 80393.056769 secs D0 => ksoftirqd/2:22 > . *A0 . 80393.056804 secs A0 => pi:22368 > . *. . 80393.056854 secs > *B0 . . 80393.060727 secs > ... > > Signed-off-by: Changbin Du > --- > tools/perf/builtin-sched.c | 4 +++- > tools/perf/util/thread.c | 1 + > tools/perf/util/thread.h | 1 + > 3 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c > index 83283fe..53bb8df 100644 > --- a/tools/perf/builtin-sched.c > +++ b/tools/perf/builtin-sched.c > @@ -1580,7 +1580,7 @@ static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel, > > timestamp__scnprintf_usec(timestamp, stimestamp, sizeof(stimestamp)); > color_fprintf(stdout, color, " %12s secs ", stimestamp); > - if (new_shortname || (verbose > 0 && sched_in->tid)) { > + if (new_shortname || sched_in->comm_changed || (verbose > 0 && sched_in->tid)) { > const char *pid_color = color; > > if (thread__has_color(sched_in)) > @@ -1588,6 +1588,8 @@ static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel, > > color_fprintf(stdout, pid_color, "%s => %s:%d", > sched_in->shortname, thread__comm_str(sched_in), sched_in->tid); > + > + sched_in->comm_changed = false; > } > > if (sched->map.comp && new_cpu) > diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c > index 68b65b1..c660fe6 100644 > --- a/tools/perf/util/thread.c > +++ b/tools/perf/util/thread.c > @@ -212,6 +212,7 @@ static int ____thread__set_comm(struct thread *thread, const char *str, > unwind__flush_access(thread); > } > > + thread->comm_changed = true; > thread->comm_set = true; > > return 0; > diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h > index 40cfa36..b9a328b 100644 > --- a/tools/perf/util/thread.h > +++ b/tools/perf/util/thread.h > @@ -27,6 +27,7 @@ struct thread { > int cpu; > refcount_t refcnt; > char shortname[3]; > + bool comm_changed; > bool comm_set; > int comm_len; > bool dead; /* if set thread has exited */ > -- > 2.7.4 > -- Thanks, Changbin Du