From mboxrd@z Thu Jan 1 00:00:00 1970 From: Francis Giraldeau Subject: Re: Some questions about Lttng Date: Tue, 19 Jun 2012 11:28:01 +0200 Message-ID: <4FE04621.3070806__33867.8794717$1340098146$gmane$org@gmail.com> References: <6539770C71C3814BB0BFC2DBEBD105087948C2@CORPUSMX30B.corp.emc.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1143269404==" Return-path: Received: from mail-lb0-f176.google.com ([209.85.217.176]) by ltt.polymtl.ca with esmtp (Exim 4.72) (envelope-from ) id 1SgujM-0007zO-Uf for lttng-dev@lists.lttng.org; Tue, 19 Jun 2012 05:28:14 -0400 Received: by lboj14 with SMTP id j14so6775669lbo.35 for ; Tue, 19 Jun 2012 02:28:06 -0700 (PDT) In-Reply-To: <6539770C71C3814BB0BFC2DBEBD105087948C2@CORPUSMX30B.corp.emc.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lttng-dev-bounces@lists.lttng.org To: "lttng-dev@lists.lttng.org" List-Id: lttng-dev@lists.lttng.org Ceci est un message signC) cryptographiquement au format MIME. --===============1143269404== Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080506030307040101090503" Ceci est un message signé cryptographiquement au format MIME. --------------ms080506030307040101090503 Content-Type: multipart/alternative; boundary="------------060507010207030605060807" This is a multi-part message in MIME format. --------------060507010207030605060807 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Le 2012-06-19 05:50, Zheng.Chang@emc.com a =E9crit : > > Hi folks, > > =20 > > I'm studying how to use Lttng now. I built a kernel which version is > 2.6.38 and ran with lttng 2.0. > > I got some confused when I started to use it. Here are my questions: > > =20 > > 1. I didn't see kernel patches for kernel 3.x. Does it mean kernel 3.x > support it already? > You don't need a kernel patch with lttng 2.0, only modules are required. It uses the tracepoints already present in the kernel, and trace system calls, and uses perf performance counters and kprobes. > 2. I tried to do something like, dump the arguments of system call, or > dump a backtrace in a specified function. But the output of lttng is > very limited. Is there a way to do that with lttng? > If system calls are enabled, arguments are supposed to be dumped (option --syscall to lttng enable-event). If it's not the case, then are you sure you are using lttng 2.0 and not 0.12? ;) Because the older version has a different behavior. One additional note: few system calls do not have all their arguments decoded in lttng 2, but there are only a few. > 3. I looked into some UST examples and found here are three header > files: tracepoint.h, tracepoint-event.h and ust-tracepoint-event.h. > They have some duplicated macro definitions like TRACEPOINT_EVENT. > The macros are quite complicated. Some includes files are included more than once to generate various portion of the tracepoint code. So, my advice here is to take a working example and adapt it to your needs. > And the examples includes all of these three header files despite no > conflict here. Could someone help to explain the intention? > > 4. Once I defined a tracepoint in my code, seems some initializations > would register default probe into the hook point. How to disable the > default probe and register my self-defined probes? > You mean, call a custom function when tracepoint is executed? Maybe somebody else has an answer, but AFAIK this is not possible. But you could make a wrapper to your tracepoint and then call your additional function there. > 5. Does lttng-ust support dynamic traceing like kprobe? > AFAIK, the kernel tracer supports kprobe, but not UST. Maybe somebody else can confirm/infirm the dynamic tracepoint feature in user-space? You can use a feature of GCC to regiter callback on function entry and exit, but since it executes for all functions, then the overhead is very high. You can have a look here: https://github.com/giraldeau/workload-kit/blob/master/ust/cyg.c Cheers, Francis --------------060507010207030605060807 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Le 2012-06-19 05:50, Zheng.Chang@emc.com a écrit :

Hi folks,

 

I’m studying how to use Lttng now. I= built a kernel which version is 2.6.38 and ran with lttng 2.0.

I got some confused when I started to use it. Here are my questions:

 

1. I didn’t see kernel patches for k= ernel 3.x. Does it mean kernel 3.x support it already?


You don't need a kernel patch with lttng 2.0, only modules are required. It uses the tracepoints already present in the kernel, and trace system calls, and uses perf performance counters and kprobes.

2. I tried to do something like, dump the arguments of system call, or dump a backtrace in a specified function. But the output of lttng is very limited. Is there a way to do that with lttng?


If system calls are enabled, arguments are supposed to be dumped (option --syscall to lttng enable-event). If it's not the case, then are you sure you are using lttng 2.0 and not 0.12? ;) Because the older version has a different behavior. One additional note: few system calls do not have all their arguments decoded in lttng 2, but there are only a few.

3. I looked into some UST examples and found here are three header files:  tracepoint.h, tracepoint-event.h and ust-tracepoint-event.h. They have some duplicated macro definitions like TRACEPOINT_EVENT.


The macros are quite complicated. Some includes files are included more than once to generate various portion of the tracepoint code. So, my advice here is to take a working example and adapt it to your needs.

And the examples includes all of these three header files despite no conflict here. Could someone help to explain the intention?

4. Once I defined a tracepoint in my code,= seems some initializations would register default probe into the hook point.  How to disable the default probe and = ; register my self-defined probes?


You mean, call a custom function when tracepoint is executed? Maybe somebody else has an answer, but AFAIK this is not possible. But you could make a wrapper to your tracepoint and then call your additional function there.

5. Does lttng-ust support dynamic traceing= like kprobe?


AFAIK, the kernel tracer supports kprobe, but not UST. Maybe somebody else can confirm/infirm the dynamic tracepoint feature in user-space?

You can use a feature of GCC to regiter callback on function entry and exit, but since it executes for all functions, then the overhead is very high. You can have a look here:

https://github.com/giraldeau/workload-kit/blob/master/ust/cyg.c=

Cheers,

Francis
--------------060507010207030605060807-- --------------ms080506030307040101090503 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: Signature cryptographique S/MIME MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIMUjCC BVwwggREoAMCAQICEGWn7N/yOaERpG8kZX1Cua0wDQYJKoZIhvcNAQEFBQAwgd0xCzAJBgNV BAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1 c3QgTmV0d29yazE7MDkGA1UECxMyVGVybXMgb2YgdXNlIGF0IGh0dHBzOi8vd3d3LnZlcmlz aWduLmNvbS9ycGEgKGMpMDkxHjAcBgNVBAsTFVBlcnNvbmEgTm90IFZhbGlkYXRlZDE3MDUG A1UEAxMuVmVyaVNpZ24gQ2xhc3MgMSBJbmRpdmlkdWFsIFN1YnNjcmli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zuxb6lmWUweVHN3ehd4V/Nk0HwGQrOFkaPa5PYPa2Va56kLbWd6bnC4C0T6 a+6SjzxN4/E3iRr929BmGbDlhw5da783xn16NoG3bNjcaoQG9uMqzv1UfSKm+gtmQkt/Drj0 PAypE0OJSfzwQdndWm5kr+gxHWSxsFSs8qFA1HCIVNG1H6beU51iLiQSLlC1Vu7Ftny0+t/N lGrIMslzyc2tvTPOM7eXqfRzx/rf8zT86IgqnTu3gy3gQGnDDGTUHkH4AAAAAAAA --------------ms080506030307040101090503-- --===============1143269404== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 7bit _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev --===============1143269404==--