linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Joel Fernandes <joel@joelfernandes.org>
Cc: akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com,
	carmenjackson@google.com, dan.j.williams@intel.com,
	dancol@google.com, jglisse@redhat.com, linux-mm@kvack.org,
	mayankgupta@google.com, mhocko@suse.com, minchan@kernel.org,
	mm-commits@vger.kernel.org, rcampbell@nvidia.com,
	timmurray@google.com, torvalds@linux-foundation.org,
	vbabka@suse.cz, willy@infradead.org
Subject: Re: [patch 026/158] mm: emit tracepoint when RSS changes
Date: Mon, 2 Dec 2019 16:56:01 -0500	[thread overview]
Message-ID: <20191202165601.42366c21@gandalf.local.home> (raw)
In-Reply-To: <20191202211345.GE17234@google.com>

On Mon, 2 Dec 2019 16:13:45 -0500
Joel Fernandes <joel@joelfernandes.org> wrote:

> On Mon, Dec 02, 2019 at 12:14:15PM -0500, Steven Rostedt wrote:
> > On Sat, 30 Nov 2019 17:50:30 -0800
> > akpm@linux-foundation.org wrote:
> >   
> > >  /* Optimized variant when page is already known not to be PageAnon */
> > > --- a/include/trace/events/kmem.h~mm-emit-tracepoint-when-rss-changes
> > > +++ a/include/trace/events/kmem.h
> > > @@ -316,6 +316,27 @@ TRACE_EVENT(mm_page_alloc_extfrag,
> > >  		__entry->change_ownership)
> > >  );
> > >  
> > > +TRACE_EVENT(rss_stat,
> > > +
> > > +	TP_PROTO(int member,
> > > +		long count),
> > > +
> > > +	TP_ARGS(member, count),
> > > +
> > > +	TP_STRUCT__entry(
> > > +		__field(int, member)
> > > +		__field(long, size)
> > > +	),
> > > +
> > > +	TP_fast_assign(
> > > +		__entry->member = member;
> > > +		__entry->size = (count << PAGE_SHIFT);  
> > 
> > It's best to put all calculations (including shifts) in the print part,
> > as that's the slow path. The TP_fast_assign() is done when the trace
> > point is triggered (during the execution of the code). It's best to
> > keep this in the slow path (TP_printk).
> > 
> > 		__entry->count = count;
> >   
> > > +	),
> > > +
> > > +	TP_printk("member=%d size=%ldB",
> > > +		__entry->member,
> > > +		__entry->size)  
> > 
> > 		__entry->count << PAGE_SHIFT)  
> 
> Ah. Android users now use a tool called perfetto which gather raw trace
> (binary format). So such shifting will have to be done by userspace then if
> we did it this way. And I'm afraid this patch has been in circulation for
> quite some time now that may cause major pains in changing userspace tooling
> now :-\
> 

I've been trying to get libtraceevent into a standard library, and
it's been ready to go. Can your tool please use that. It can handle this
without issue. Just feed it the format file (that's exported to
user space via the tracefs file system).

-- Steve


  reply	other threads:[~2019-12-02 21:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-01  1:50 [patch 026/158] mm: emit tracepoint when RSS changes akpm
2019-12-02 17:14 ` Steven Rostedt
2019-12-02 21:13   ` Joel Fernandes
2019-12-02 21:56     ` Steven Rostedt [this message]
2019-12-02 23:45       ` Joel Fernandes
2019-12-02 23:53         ` Steven Rostedt
2019-12-03  2:48           ` Primiano Tucci
2019-12-03  5:38             ` Mathieu Desnoyers
2019-12-03 10:44               ` Primiano Tucci
2019-12-03 15:58                 ` Steven Rostedt
2019-12-04  4:08                   ` Joel Fernandes
2019-12-03 14:53             ` Steven Rostedt

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=20191202165601.42366c21@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=carmenjackson@google.com \
    --cc=dan.j.williams@intel.com \
    --cc=dancol@google.com \
    --cc=jglisse@redhat.com \
    --cc=joel@joelfernandes.org \
    --cc=linux-mm@kvack.org \
    --cc=mayankgupta@google.com \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=rcampbell@nvidia.com \
    --cc=timmurray@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).