public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Fwd: probing user space function on Ubuntu
       [not found] <AANLkTinT+h1fj3k2s_jfZu_xqpuCUWj4fDZfTDKdG1Vb@mail.gmail.com>
@ 2011-02-16 19:49 ` Conoscenza Silente
  2011-02-16 20:54   ` Adrien Kunysz
  2011-02-16 20:59   ` Frank Ch. Eigler
  0 siblings, 2 replies; 6+ messages in thread
From: Conoscenza Silente @ 2011-02-16 19:49 UTC (permalink / raw)
  To: systemtap

hi all
I am completely new to systemtap. I work with Ubuntu 10.10
I would like to probe functions in my application so user-space probing.

I created the following "test.stp" file run using "stap test.stp" and
I am returned the following error.

" - semantic error: process probes not available without kernel
CONFIG_UTRACE while
resolving probe point process("/home/me/appName").function("main")  -"

I goggle it and I need to have utrace in kernel  in place.
Do you know how to get it and IF it is possible to have that in Ubuntu?
Was anyone successful?

Best regards
AFG

// test.stp
probe process("/home/me/appName").function( "main" ){
        printf ("here is main" )
}

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

* Re: Fwd: probing user space function on Ubuntu
  2011-02-16 19:49 ` Fwd: probing user space function on Ubuntu Conoscenza Silente
@ 2011-02-16 20:54   ` Adrien Kunysz
  2011-02-16 20:59   ` Frank Ch. Eigler
  1 sibling, 0 replies; 6+ messages in thread
From: Adrien Kunysz @ 2011-02-16 20:54 UTC (permalink / raw)
  To: Conoscenza Silente; +Cc: systemtap

[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]

On Wed, Feb 16, 2011 at 07:49:18PM +0000, Conoscenza Silente wrote:
> I am completely new to systemtap. I work with Ubuntu 10.10
> I would like to probe functions in my application so user-space probing.
> 
> I created the following "test.stp" file run using "stap test.stp" and
> I am returned the following error.
> 
> " - semantic error: process probes not available without kernel
> CONFIG_UTRACE while
> resolving probe point process("/home/me/appName").function("main")  -"
> 
> I goggle it and I need to have utrace in kernel  in place.
> Do you know how to get it and IF it is possible to have that in Ubuntu?
> Was anyone successful?

You need to rebuild your kernel with the utrace patch. The utrace patch
is available from http://people.redhat.com/roland/utrace/ but I am not
sure whether it applies cleanly to a regular Ubuntu kernel. Details on
how to rebuild an Ubuntu kernel can probably be found in the Ubuntu
documentation.

It looks like this is not covered in the Ubuntu page of the SystemTap
wiki. If you build an Ubuntu kernel including the utrace patch you are
very welcome to document the process at http://www.sourceware.org/systemtap/wiki/SystemtapOnUbuntu
so the next person to ask can benefit from it :)

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: Fwd: probing user space function on Ubuntu
  2011-02-16 19:49 ` Fwd: probing user space function on Ubuntu Conoscenza Silente
  2011-02-16 20:54   ` Adrien Kunysz
@ 2011-02-16 20:59   ` Frank Ch. Eigler
  2011-02-17  0:16     ` Conoscenza Silente
  1 sibling, 1 reply; 6+ messages in thread
From: Frank Ch. Eigler @ 2011-02-16 20:59 UTC (permalink / raw)
  To: Conoscenza Silente; +Cc: systemtap


Hi -

abruzzoforteegentile wrote:

> I am completely new to systemtap.

Welcome!

> I work with Ubuntu 10.10
> I would like to probe functions in my application so user-space probing.
> " - semantic error: process probes not available without kernel
> CONFIG_UTRACE while [...]

Right.

> Do you know how to get it and IF it is possible to have that in Ubuntu?
> Was anyone successful?

Yes, several people have built utrace-patched ubuntu kernels in the
past, but I believe we lack a recipe in our wiki page for that.
Here's a PPA though: https://launchpad.net/~speijnik/+archive/utrace-kernel
(We'd love to have ubuntu kernel maintainers consider carrying the patch.)

- FChE

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

* Re: Fwd: probing user space function on Ubuntu
  2011-02-16 20:59   ` Frank Ch. Eigler
@ 2011-02-17  0:16     ` Conoscenza Silente
  2011-02-17  1:08       ` Fwd: systemtap " Frank Ch. Eigler
  0 siblings, 1 reply; 6+ messages in thread
From: Conoscenza Silente @ 2011-02-17  0:16 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: systemtap

o problem to write about it and Thanks for the offer! Maintaining
could it be a challenge for me as I am now.
Before writing few lines of recipes let me understand something that
it is also interesting to know in general,
I found myself now in this situation:
giving 'uname -r" to my  2 Ubuntu machines I cannot see the kernel
version matching the patches

// my machines
Ubuntu 10.10 2.6.35-25-generic
Ubuntu 10.04.2 LTS 2.6.32-28-generic

//patch version
2.6.35-27.47
2.6.35-26.46

I think that this is a common scenario where it would be nice to find
a recipe written in the wiki.
Let me find out ( and write on that wiki ) whether is possible and how
to make this patch for any version
( need to contact UBUNTU people ).
AFG

On Wed, Feb 16, 2011 at 3:59 PM, Frank Ch. Eigler <fche@redhat.com> wrote:
>
> Hi -
>
> abruzzoforteegentile wrote:
>
>> I am completely new to systemtap.
>
> Welcome!
>
>> I work with Ubuntu 10.10
>> I would like to probe functions in my application so user-space probing.
>> " - semantic error: process probes not available without kernel
>> CONFIG_UTRACE while [...]
>
> Right.
>
>> Do you know how to get it and IF it is possible to have that in Ubuntu?
>> Was anyone successful?
>
> Yes, several people have built utrace-patched ubuntu kernels in the
> past, but I believe we lack a recipe in our wiki page for that.
> Here's a PPA though: https://launchpad.net/~speijnik/+archive/utrace-kernel
> (We'd love to have ubuntu kernel maintainers consider carrying the patch.)
>
> - FChE
>

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

* Re: Fwd: systemtap probing user space function on Ubuntu
  2011-02-17  0:16     ` Conoscenza Silente
@ 2011-02-17  1:08       ` Frank Ch. Eigler
       [not found]         ` <AANLkTikdZQMs2BQ+mj=ErEe8526OqnLyeKVh+1v-avvb@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Ch. Eigler @ 2011-02-17  1:08 UTC (permalink / raw)
  To: Conoscenza Silente; +Cc: systemtap, debian

Hi -

abruzzoforteegentile wrote:
>>> [... trying to run systemtap user-space probing on ubuntu 10.10 ...]
>> [... need utrace kernel ...]
> [...]
> Before writing few lines of recipes let me understand something that
> it is also interesting to know in general,
> [...]
> // my machines
> Ubuntu 10.10 2.6.35-25-generic
> Ubuntu 10.04.2 LTS 2.6.32-28-generic
> //patch version
> 2.6.35-27.47
> 2.6.35-26.46
> I think that this is a common scenario where it would be nice to find
> a recipe written in the wiki.

Yeah - it is confusing (and more so to a Ubuntu newbie like I am).

> Let me find out ( and write on that wiki ) whether is possible and how
> to make this patch for any version
> ( need to contact UBUNTU people ).

For what it's worth, I've had a first userspace 'hello world' stap
success on ubuntu maverick.  The steps consisted of:

# echo 'deb http://ppa.launchpad.net/speijnik/utrace-kernel/ubuntu maverick main' >> /etc/apt/sources.list
# echo 'deb-src http://ppa.launchpad.net/speijnik/utrace-kernel/ubuntu maverick main' >> /etc/apt/sources.list
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6aa1691f
# apt-get install 'linux-image-2.6.35-26-server=2.6.35-26.46~utrace0'
# apt-get install 'linux-image-2.6.35-26-server-dbgsym=2.6.35-26.46~utrace0'
# apt-get install 'linux-headers-2.6.35-26-server=2.6.35-26.46~utrace0'
# apt-get install systemtap # or build your own
# stap -tv -e 'probe process("a.out").function("main") {}' -c ./a.out

No other symlinking magic setup was necessary!
Much thanks to Stephan Peijnik for maintaining that PPA.

- FChE

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

* Re: Fwd: systemtap probing user space function on Ubuntu
       [not found]         ` <AANLkTikdZQMs2BQ+mj=ErEe8526OqnLyeKVh+1v-avvb@mail.gmail.com>
@ 2011-02-19  1:59           ` Frank Ch. Eigler
  0 siblings, 0 replies; 6+ messages in thread
From: Frank Ch. Eigler @ 2011-02-19  1:59 UTC (permalink / raw)
  To: Conoscenza Silente; +Cc: systemtap

Hi -

> [...]  I am just a bit scary about the version of the kernel vs the
> version of the patch.  Are you telling me that you make it work even
> if the 2 versions are different ?
> Example
> kernel: 2.6.35-24-generic
> patch: 2.6.35-27.47

What does ... dpkg -l "linux*" ... on a nice wide screen show you?

The utrace-patched kernel PPA appears to be missing its matching
kernel-dbgsym, now on a closer look.  This means that while user-space
probes work, some kernel.* won't (will be skipped due to build-id
mismatches).

One may need to replicate the PPA work and generate a ddeb locally.

- FChE

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

end of thread, other threads:[~2011-02-19  1:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AANLkTinT+h1fj3k2s_jfZu_xqpuCUWj4fDZfTDKdG1Vb@mail.gmail.com>
2011-02-16 19:49 ` Fwd: probing user space function on Ubuntu Conoscenza Silente
2011-02-16 20:54   ` Adrien Kunysz
2011-02-16 20:59   ` Frank Ch. Eigler
2011-02-17  0:16     ` Conoscenza Silente
2011-02-17  1:08       ` Fwd: systemtap " Frank Ch. Eigler
     [not found]         ` <AANLkTikdZQMs2BQ+mj=ErEe8526OqnLyeKVh+1v-avvb@mail.gmail.com>
2011-02-19  1:59           ` 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).