public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Is there a way to tell stap where to find include headers?
@ 2019-03-07 22:16 Lan, Jay
  2019-03-08  2:32 ` Frank Ch. Eigler
  0 siblings, 1 reply; 4+ messages in thread
From: Lan, Jay @ 2019-03-07 22:16 UTC (permalink / raw)
  To: Systemtap

Hi,

I am new to systemtap and am writing a systemtap script on Mellanox OFED ('mofed') kernel modules. The mofed provides its subset of kernel include files at different location from that of a kernel-devel. The mofed header files should be checked ahead of those from kernel-devel.

Is there a way to tell stap where to find the mofed header files? I searched the web and read man pages, but came out nothing... Any pointer is appreciated! TIA!

Regards,
Jay

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is there a way to tell stap where to find include headers?
  2019-03-07 22:16 Is there a way to tell stap where to find include headers? Lan, Jay
@ 2019-03-08  2:32 ` Frank Ch. Eigler
  2019-03-08  2:55   ` Lan, Jay
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Ch. Eigler @ 2019-03-08  2:32 UTC (permalink / raw)
  To: Lan, Jay; +Cc: Systemtap

"Lan, Jay" <jay.lan@hpe.com> writes:

> I am new to systemtap and am writing a systemtap script on Mellanox
> OFED ('mofed') kernel modules. The mofed provides its subset of kernel
> include files at different location from that of a kernel-devel. The
> mofed header files should be checked ahead of those from kernel-devel.
>
> Is there a way to tell stap where to find the mofed header files?

systemtap looks for headers in a couple of contexts: tracepoints (for
trace("...") probes), type declarations (for @cast ops).  For the
former, not sure.
For the latter,
   @cast(ptr, "typename", "kernel</path/to/header>")->field
does work.

- FChE

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is there a way to tell stap where to find include headers?
  2019-03-08  2:32 ` Frank Ch. Eigler
@ 2019-03-08  2:55   ` Lan, Jay
  2019-03-08  3:02     ` Frank Ch. Eigler
  0 siblings, 1 reply; 4+ messages in thread
From: Lan, Jay @ 2019-03-08  2:55 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: Systemtap

Thanks for quick reply, Frank!

In the exmaple you mentioned
    @cast(ptr, "typename", "kernel</path/to/header>")->field
I assume 'kernel' tells stap to look at /lib/modules/<uname -r>/build/include/. But for external kernel modules such as mofed, how can I tell stap what other location to look at? The mofed headers are installed to /usr/src/ofa_kernel/.../include/.

Thanks,
Jay

On 03/07/2019 06:32 PM, Frank Ch. Eigler wrote:

"Lan, Jay" <jay.lan@hpe.com><mailto:jay.lan@hpe.com> writes:



I am new to systemtap and am writing a systemtap script on Mellanox
OFED ('mofed') kernel modules. The mofed provides its subset of kernel
include files at different location from that of a kernel-devel. The
mofed header files should be checked ahead of those from kernel-devel.

Is there a way to tell stap where to find the mofed header files?



systemtap looks for headers in a couple of contexts: tracepoints (for
trace("...") probes), type declarations (for @cast ops).  For the
former, not sure.
For the latter,
   @cast(ptr, "typename", "kernel</path/to/header>")->field
does work.

- FChE



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is there a way to tell stap where to find include headers?
  2019-03-08  2:55   ` Lan, Jay
@ 2019-03-08  3:02     ` Frank Ch. Eigler
  0 siblings, 0 replies; 4+ messages in thread
From: Frank Ch. Eigler @ 2019-03-08  3:02 UTC (permalink / raw)
  To: Lan, Jay; +Cc: Systemtap

Hi -

On Fri, Mar 08, 2019 at 02:55:11AM +0000, Lan, Jay wrote:
> In the exmaple you mentioned
>     @cast(ptr, "typename", "kernel</path/to/header>")->field

> I assume 'kernel' tells stap to look at /lib/modules/<uname-r>/build/include/.

That's a good guess, but not quite.  It tells stap to invoke the
kernel build compiler / cflags to process the given header.  There
is an implicit "-Ipath" there, but that doesn't apply to /full/path names.

> But for external kernel modules such as mofed, how can I tell stap
> what other location to look at? The mofed headers are installed to
> /usr/src/ofa_kernel/.../include/.

Have you tried @cast(ptr,"foobar","kernel</usr/src/ofa..../include/foo.h")  ?

- FChE

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-08  3:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07 22:16 Is there a way to tell stap where to find include headers? Lan, Jay
2019-03-08  2:32 ` Frank Ch. Eigler
2019-03-08  2:55   ` Lan, Jay
2019-03-08  3:02     ` Frank Ch. Eigler

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 read-only IMAP folder(s) and NNTP newsgroup(s).