<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Le 2012-06-19 05:50, <a class="moz-txt-link-abbreviated" href="mailto:Zheng.Chang@emc.com">Zheng.Chang@emc.com</a> a écrit :
<blockquote
cite="mid:6539770C71C3814BB0BFC2DBEBD105087948C2@CORPUSMX30B.corp.emc.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.EmailStyle18
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Hi folks,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m studying how to use Lttng now. I built
a kernel which version is 2.6.38 and ran with lttng 2.0.<o:p></o:p></p>
<p class="MsoNormal">I got some confused when I started to use
it. Here are my questions:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">1. I didn’t see kernel patches for kernel
3.x. Does it mean kernel 3.x support it already? <o:p></o:p></p>
</div>
</blockquote>
<br>
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.
<br>
<br>
<blockquote
cite="mid:6539770C71C3814BB0BFC2DBEBD105087948C2@CORPUSMX30B.corp.emc.com"
type="cite">
<div class="WordSection1">
<p class="MsoNormal">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?</p>
</div>
</blockquote>
<br>
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. <br>
<br>
<blockquote
cite="mid:6539770C71C3814BB0BFC2DBEBD105087948C2@CORPUSMX30B.corp.emc.com"
type="cite">
<div class="WordSection1">
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">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.</p>
</div>
</blockquote>
<br>
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. <br>
<br>
<blockquote
cite="mid:6539770C71C3814BB0BFC2DBEBD105087948C2@CORPUSMX30B.corp.emc.com"
type="cite">
<div class="WordSection1">
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">And the examples includes all of these
three header files despite no conflict here. Could someone
help to explain the intention?<o:p></o:p></p>
<p class="MsoNormal">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?</p>
</div>
</blockquote>
<br>
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. <br>
<br>
<blockquote
cite="mid:6539770C71C3814BB0BFC2DBEBD105087948C2@CORPUSMX30B.corp.emc.com"
type="cite">
<div class="WordSection1">
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">5. Does lttng-ust support dynamic traceing
like kprobe?</p>
</div>
</blockquote>
<br>
AFAIK, the kernel tracer supports kprobe, but not UST. Maybe
somebody else can confirm/infirm the dynamic tracepoint feature in
user-space?<br>
<br>
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: <br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="https://github.com/giraldeau/workload-kit/blob/master/ust/cyg.c">https://github.com/giraldeau/workload-kit/blob/master/ust/cyg.c</a><br>
<br>
Cheers, <br>
<br>
Francis<br>
</body>
</html>