This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH V6] Tracepoint Tapset for Memory Subsystem


Hi Rajasekhar,

On Sat, 2009-12-12 at 00:05 +0530, Rajasekhar Duddu wrote:
> Changelog 3:
>         Defined two macros for converting the GFP_FLAGS into string
> formats.
>         Added k(ret)probe based fallback probes for all the
> Functions.

Sorry for the late feedback. I finally tested on an old 2.6.18 kernel
which didn't have the tracepoints defined. I made a couple of changes to
the fallback probes to make them work (a bit). I agree with Wenji that
having bytes_alloc be sometimes a long and sometimes a string is not
very helpful. So I made it a long always by setting it to the same value
as bytes_req. That isn't ideal, but better than having the type
mismatch. I couldn't find a good solution for the vm.kmalloc fallback,
since the function is always inlined, the return probe won't really work
(I pulled that test out of the other buildok/vm.tracepoints.stp to show
the rest does build now). Maybe someone knows a trick to get this
fallback to also work. But maybe we should just encourage people to
upgrade their kernel to one that has the tracepoints defined.

Cheers,

Mark

commit 11c015d84facc299ebcb12771ccda1975333a6bc
Author: Mark Wielaard <mjw@redhat.com>
Date:   Tue Dec 29 21:05:55 2009 +0100

  Fixup some memory tapset vm kernel function probe fallbacks.
    
  Older kernels don't have all GFP constants defined, and the fallback
  kernel function probe fallbacks don't have the same dwarf variable
  names as the kernel trace point probes. So replace them with variables
  that are available. bytes_alloc was sometimes a long and sometimes a
  string, this caused scripts to fail depending on which alternative was
  chosen for a particular kernel. So make it a long always.
  This isn't a full solution since kmalloc is always inlined which makes
  the kernel.function("kmalloc").return probe fail.
  
  * tapset/memory.stp: Define __GFP_THISNODE, __GFP_RECLAIMABLE,
    GFP_TEMPORARY, GFP_HIGHUSER_MOVABLE and GFP_THISNODE when not yet
    defined.
    (__vm.kmalloc.kp): Use $flags, not $gfp_flags. Set bytes_alloc equal
    to bytes_req.
    (__vm.kmem_cache_alloc.kp): Likewise. And use $cachep->buffer_size
    for bytes_req.
    (__vm.kmalloc_node.kp): Likewise.
    (__vm.kmem_cache_alloc_node.kp): Likewise.
    (__vm.kfree.kp): Use $ibjp for ptr, not $return.
    (__vm.kmem_cache_free.kp): Likewise.
  * testsuite/buildok/vm.tracepoints.stp: Move vm.kmalloc test to...
  * testsuite/buildok/vm.tracepoints.kmalloc.stp: ... here.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]