lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 6 Jul 2015 12:37:02 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:	Wang Nan <wangnan0@...wei.com>, a.p.zijlstra@...llo.nl,
	mingo@...hat.com, jolsa@...nel.org, peterz@...radead.org,
	namhyung@...nel.org, kan.liang@...el.com, adrian.hunter@...el.com,
	ak@...ux.intel.com, cody@...ux.vnet.ibm.com,
	jacob.w.shin@...il.com, standby24x7@...il.com, lizefan@...wei.com,
	yunlong.song@...wei.com, linux-kernel@...r.kernel.org,
	pi3orama@....com
Subject: Re: [PATCH] perf record: Allow passing perf's own pid to '--filter'

On Mon, 6 Jul 2015 10:56:50 -0300
Arnaldo Carvalho de Melo <acme@...nel.org> wrote:

> Em Mon, Jul 06, 2015 at 04:17:31AM +0000, Wang Nan escreveu:
> > This patch allows passing perf's own PID to '--filter' by using
> > '@...FPID'. This should be useful when system-widely capturing
> > tracepoints events.
> 
> Steven, does filters have any special meaning for @?

Not as of yet.


>  
> > Before this patch, when doing something like:
> > 
> >  # perf record -a -e syscalls:sys_enter_write <cmd>
> > 
> > One could easily get result like this:
> > 
> >  # /tmp/perf report --stdio
> >  ...
> >  # Overhead  Command  Shared Object       Symbol
> >  # ........  .......  ..................  ....................
> >  #
> >      99.99%  perf     libpthread-2.18.so  [.] __write_nocancel
> >      0.01%   ls       libc-2.18.so        [.] write
> >      0.01%   sshd     libc-2.18.so        [.] write
> >      ...
> > 
> > Where most events are generated by perf itself.
> > 
> > A shell trick can be done to filter perf itself out:
> > 
> >  # cat << EOF > ./tmp
> >  > #!/bin/sh
> >  > exec perf record -e ... --filter="common_pid != \$\$" -a sleep 10
> >  > EOF
> >  # chmod a+x ./tmp
> >  # ./tmp
> > 
> > However, doing so is user unfriendly.
> > 
> > This patch introduces '@...FPID' placeholder to '--filter' options. Now
> > user is allowed to the above work with:
> > 
> >   # perf record -e ... --filter="common_pid != @PERFPID' sleep 10

What about using '$' instead. That is more common to shell scripts of
being a variable.

-- Steve

> > 
> > Signed-off-by: Wang Nan <wangnan0@...wei.com>
> > ---
> >  tools/perf/Documentation/perf-record.txt |  1 +
> 
> <SNIP>
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ