linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Slavomir Kaslev <kaslevs@vmware.com>
To: "rostedt@goodmis.org" <rostedt@goodmis.org>
Cc: "pauld@redhat.com" <pauld@redhat.com>,
	"jbacik@fb.com" <jbacik@fb.com>,
	Yordan Karadzhov <ykaradzhov@vmware.com>,
	"linux-trace-devel@vger.kernel.org" 
	<linux-trace-devel@vger.kernel.org>,
	Tzvetomir Stoyanov <tstoyanov@vmware.com>
Subject: Re: [PATCH v2 1/2] trace-cmd: Optimize how pid filters are expressed
Date: Mon, 15 Apr 2019 22:55:24 +0000	[thread overview]
Message-ID: <da9af70eb678d7a0c1cfd1c2565df96743df712f.camel@vmware.com> (raw)
In-Reply-To: <20190415175919.637f28f6@gandalf.local.home>

On Mon, 2019-04-15 at 17:59 -0400, Steven Rostedt wrote:
> On Mon, 15 Apr 2019 19:47:38 +0300
> Slavomir Kaslev <kaslevs@vmware.com> wrote:
> 
> > Express pid filters as allowed/disallowed filter ranges
> > 
> >   (pid>=100&&pid<=103)  
> > 
> > instead of specifying them per pid
> > 
> >   (pid==100||pid==101||pid==102||pid==103)
> > 
> > This makes the size of the resulting filter smaller (and faster)
> > and avoids
> > overflowing the filter size limit of one page which we can hit on
> > bigger
> > machines (say >160 CPUs).
> 
> Except it breaks if we have a split.
> 
> I ran this:
> 
>  hackbench 10 &
>  tracecmd/trace-cmd record -e sched_switch cat
> /sys/kernel/debug/tracing/events/sched/sched_switch/filter
> 
> 
> Time: 0.093
> (common_pid<6959||common_pid>6969)||(common_pid<6945||common_pid>6957
> )||(next_pid<6959||next_pid>6969)||(next_pid<6945||next_pid>6957)
> 
> This was the output. Showing that we had common_pid from 6959 - 6969
> and 6945 - 6957 (a 6958 was missing), and because of this, we now
> trace
> all processes because (common_pid < 6959 || common_pid > 6957) is
> always true.
> 
> We need an "&&" there somewhere. That should have been:
> 
> ((common_pid<6959||common_pid>6969)&&(common_pid<6945||common_pid>695
> 7))||((next_pid<6959||next_pid>6969)&&(next_pid<6945||next_pid>6957))

Good catch. I've misread how the original code worked. It appends
exclude filters with && and non-exclude with ||. I'll send a fix in v3.

-- Slavi


  reply	other threads:[~2019-04-15 22:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15 16:47 [PATCH v2 0/2] Optimize pid filters and add --no-filter option Slavomir Kaslev
2019-04-15 16:47 ` [PATCH v2 1/2] trace-cmd: Optimize how pid filters are expressed Slavomir Kaslev
2019-04-15 21:59   ` Steven Rostedt
2019-04-15 22:55     ` Slavomir Kaslev [this message]
2019-04-15 16:47 ` [PATCH v2 2/2] trace-cmd: Add --no-filter option to not filter recording processes Slavomir Kaslev

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=da9af70eb678d7a0c1cfd1c2565df96743df712f.camel@vmware.com \
    --to=kaslevs@vmware.com \
    --cc=jbacik@fb.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=pauld@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tstoyanov@vmware.com \
    --cc=ykaradzhov@vmware.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;
as well as URLs for NNTP newsgroup(s).