lkml.org 
[lkml]   [2018]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RESEND PATCH] perf sched map: re-annotate shortname if thread comm changed
    Hi,

    On Fri, Mar 02, 2018 at 12:38:45PM +0100, Jiri Olsa wrote:
    > On Fri, Mar 02, 2018 at 06:52:54PM +0800, Du, Changbin wrote:
    > > Hello, any comment?
    >
    > sry, overlooked this one
    >
    > SNIP
    >
    > > > 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;
    >
    > I don't like that it's in struct thread and set by generic function,
    > and just one command (sched) checks/sets it back.. I'd rather see it
    > in thread::priv area..

    100% agreed.


    > on the other hand it's simple enough and looks
    > like generic solution would be more tricky

    What about adding perf_sched__process_comm() to set it in the
    thread::priv?

    Thanks,
    Namhyung

    \
     
     \ /
      Last update: 2018-03-02 15:51    [W:3.606 / U:0.296 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site