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]
Message-ID: <20110314215603.GD2388@ghostprotocols.net>
Date:	Mon, 14 Mar 2011 18:56:03 -0300
From:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To:	Frederic Weisbecker <fweisbec@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	Stephane Eranian <eranian@...gle.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Hitoshi Mitake <mitake@....info.waseda.ac.jp>
Subject: Re: [RFC PATCH 0/4] perf: Custom contexts

Em Mon, Mar 14, 2011 at 10:20:53PM +0100, Frederic Weisbecker escreveu:
> On Mon, Mar 14, 2011 at 06:03:15PM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Mon, Mar 14, 2011 at 09:51:02PM +0100, Frederic Weisbecker escreveu:
> > > On Mon, Mar 14, 2011 at 05:43:41PM -0300, Arnaldo Carvalho de Melo wrote:

> > But starter on a starter? Couldn't grok, could you provide an example?
> 
> I have no strong example in mind.
> 
> But one may want to count instructions when we are in an interrupt and
> lock A is held.

Those would be and/or starter/stopper expressions, something like:

$ perf record -e instructions@(irq:irq_handler_entry(irq=eth0) && lock:lock_acquired(foo_lock))..irq:irq_handler_exit(\1) \
	      -e instructions \
	netperf

when all starters before the stopper are valid, we entered a range.
 
> Or count instruction when A and B are held.

Using wildcards that matches just the things we want to make it a bit
more compact:

$ perf record -e inst*@(irq:*entry(irq=eth0) && lock:*acquired(A) && \
			lock:*acquired(B))..(lock:*release(A) || lock:*release(B)) \
	./my_workload

Parenthesis don't have to be used just for filters :) Just like in C,
they can be used to express the list of parameters for a function or for
expressions, etc.

> Or count instruction in page faults happening in read() syscall.

We would need to use 'perf probe' first to insert the entry and exit
probes on the page fault handling path:

[root@...icio ~]# perf list *fault* *:*fault*

List of pre-defined events (to be used in -e):
  page-faults OR faults                      [Software event]
  minor-faults                               [Software event]
  major-faults                               [Software event]
  alignment-faults                           [Software event]
  emulation-faults                           [Software event]

  kvm:kvm_page_fault                         [Tracepoint event]
[root@...icio ~]#

But then an expression could be used like I showed above for the
previous use case you mentioned.

> Event range define a state, and anytime you need to profile/trace a
> desired stacked state, starters on starters can be a good solution,
> thus even a common practice.

See above, is that what you're thinking about?
  
> > But I could think of this as a way to express filters:
> > 
> > $ perf record -e instructions@irq:irq:irq_handler_entry(irq=eth0)..irq:irq_handler_exit(\1) \
> > 	      -e instructions \
> > 	netperf
> > 
> > looks quite natural for someone used to git and sed, i.e. developers :)
> 
> Yeah indeed, I like filters defined in parenthesis after the event!

:-)

- Arnaldo
--
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