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-next>] [day] [month] [year] [list]
Date:	Thu, 6 Aug 2009 07:20:59 -0400
From:	"Frank Ch. Eigler" <fche@...hat.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	Pekka Enberg <penberg@...helsinki.fi>, Ingo Molnar <mingo@...e.hu>,
	acme <acme@...hat.com>, Steven Rostedt <rostedt@...dmis.org>,
	Frédéric Weisbecker <fweisbec@...il.com>,
	Eduard-Gabriel Munteanu <eduard.munteanu@...ux360.ro>,
	roland <roland@...hat.com>,
	Christoph Hellwig <hch@...radead.org>,
	Masami Hiramatsu <mhiramat@...hat.com>,
	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
	linux-kernel@...r.kernel.org
Subject: Re: malloc() tracing in perf?

Hi -

On Thu, Aug 06, 2009 at 10:16:50AM +0200, Peter Zijlstra wrote:
> [...]
> > But then it hit me, why can't I have kmemtrace + perf but for 
> > user-space? Something like the "Malloc Trace" shown here:
> > [...]

> I seem to have heard people are working on such a thing, but I can't
> seem to find a single LKML post with 'uprobe' in the subject in the
> past two years [...]

That work is ongoing, and being discussed on utrace-devel@...hat.com,
since it is a prerequisite.  One of the widgets that is being proposed
for it is an ftrace engine frontend for uprobes, paralleling the one
mhiramat wrote for kprobes.


> Now doing probes on userspace is hard because you need to know more
> about the userspace bits than a kernel really ought to be interested
> in.  [...]  Anyway, like you say, it has uses (potentially very
> powerful ones), Sun/Apple do it with Dtrace, Linux wants it but I
> don't think we quite agreed on how to do it :-)

While these deliberations are ongoing, you can use systemtap.  Probing
random places in userspace is about as casual as probing the kernel:


# stap -e '
   probe process("/lib/libc.so.6").function("malloc").return,
         process("/lib/libc.so.6").function("free").return
   { println(probfunc()," ",$$parms," ",$$return) }
' -c 'ls'   # -c 'CMD ARGS'

__libc_malloc bytes=0x238  return=0x1524010 
__libc_malloc bytes=0x238  return=0x1524010 
__libc_malloc bytes=0x78  return=0x1524250 
__libc_malloc bytes=0xa  return=0x15242d0 
__libc_free mem=0x1524250  
__libc_free mem=0x1524010  
__libc_malloc bytes=0x64  return=0x1524010 
__libc_malloc bytes=0x16  return=0x1524080 
__libc_free mem=0x1524010  
__libc_malloc bytes=0x64  return=0x1524010 
[...]
__libc_free mem=0x1524490  
__libc_free mem=0x1524500  
__libc_free mem=0x15245e0  
__libc_free mem=0x1524620  
__libc_free mem=0x1524430  
__libc_free mem=0x1524570  
__libc_free mem=0x1524660  
__libc_free mem=0x15246d0  
__libc_free mem=0x15242d0  

You can google some other success stories or ask for more help at
systemtap@...rceware.org.


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