<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1505784030;
mso-list-type:hybrid;
mso-list-template-ids:-1960924686 268435471 268435481 268435483 268435471 268435481 268435483 268435471 268435481 268435483;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l1
{mso-list-id:1757484136;
mso-list-type:hybrid;
mso-list-template-ids:321552282 1488371616 268435459 268435461 268435457 268435459 268435461 268435457 268435459 268435461;}
@list l1:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l1:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l1:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l1:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l2
{mso-list-id:1943415826;
mso-list-type:hybrid;
mso-list-template-ids:709781818 -1735513490 268435459 268435461 268435457 268435459 268435461 268435457 268435459 268435461;}
@list l2:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l2:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l2:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l2:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l2:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l2:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l2:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l2:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l2:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></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]-->
</head>
<body link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">Is LTTng intended to support userspace applications that change their UID at run-time?</span></b><span lang="EN-US"> As in, is there an expected behavior for when this happens?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">For example:<o:p></o:p></span></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1"><span lang="EN-US">Embedded device boots<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1"><span lang="EN-US">My daemon is launched as root via systemd<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1"><span lang="EN-US">Runs privileged code<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1"><span lang="EN-US">Changes UID to a less privileged user (500)<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1"><span lang="EN-US">Creates LTTng session<o:p></o:p></span></li><ol style="margin-top:0cm" start="1" type="a">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level2 lfo1"><span lang="EN-US">If session already exists, destroy it first<o:p></o:p></span></li></ol>
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1"><span lang="EN-US"><if ‘systemctl stop’ is called>: Destroy session<o:p></o:p></span></li><ol style="margin-top:0cm" start="1" type="a">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level2 lfo1"><span lang="EN-US">Otherwise it will be destroyed next daemon launch in step 5<o:p></o:p></span></li></ol>
</ol>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">This causes many conflicts with the trace folders that are created. Most of the time, LTTng creates a folder + metadata for both root and the user, then puts traces in the user folder. Other times, it may create a folder
just for the user. This is seemingly random, since it’s a fresh device boot each time. If the daemon is launched directly (i.e.
<i>not </i>from systemd), then the root folder gets the traces and the user folder gets the metadata. Here is a more detailed explanation:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td width="156" valign="top" style="width:116.85pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><b><span lang="EN-US">Case<o:p></o:p></span></b></p>
</td>
<td width="230" valign="top" style="width:172.2pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><b><span lang="EN-US">Command<o:p></o:p></span></b></p>
</td>
<td width="230" valign="top" style="width:172.2pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><b><span lang="EN-US">Result<o:p></o:p></span></b></p>
</td>
<td width="245" valign="top" style="width:183.75pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><b><span lang="EN-US"><o:p> </o:p></span></b></p>
</td>
<td width="662" valign="top" style="width:496.65pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><b><span lang="EN-US">Comments<o:p></o:p></span></b></p>
</td>
</tr>
<tr>
<td width="156" valign="top" style="width:116.85pt;background:#F2F2F2;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><b><span lang="EN-US" style="color:black">1</span></b><b><span lang="EN-US"><o:p></o:p></span></b></p>
</td>
<td width="230" valign="top" style="width:172.2pt;background:#F2F2F2;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F4E79">[Device boot]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F4E79">systemctl start daemon<o:p></o:p></span></p>
</td>
<td width="230" valign="top" style="width:172.2pt;background:#F2F2F2;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="color:black">…../uid/500/32-bit </span>
<span lang="EN-US" style="font-family:Wingdings;color:black">à</span><span lang="EN-US" style="color:black"> has metadata and trace logs</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><i><span lang="EN-US" style="color:black">Most times, this also happens:</span></i><i><span lang="EN-US"><o:p></o:p></span></i></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">…../uid/0/32-bit </span>
<span lang="EN-US" style="font-family:Wingdings;color:black">à</span><span lang="EN-US" style="color:black"> has metadata but no trace logs</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</td>
<td width="245" valign="top" style="width:183.75pt;background:#F2F2F2;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span style="color:black"><img width="159" height="107" style="width:1.6562in;height:1.1145in" id="Picture_x0020_1" src="cid:image003.png@01D572F1.6F791A30" alt="cid:image001.png@01D56F9D.AF158770"></span><span lang="EN-US"><o:p></o:p></span></p>
</td>
<td width="662" valign="top" style="width:496.65pt;background:#F2F2F2;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="color:black">Occasionally, the uid/0 folder is not created at all. This seems random, since this is tested by rebooting the device several times.</span><span lang="EN-US"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="156" valign="top" style="width:116.85pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><b><span lang="EN-US">2<o:p></o:p></span></b></p>
</td>
<td width="230" valign="top" style="width:172.2pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F4E79">[Device boot]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F4E79">systemctl start daemon<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F4E79">systemctl stop daemon<o:p></o:p></span></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph" style="color:#1F4E79;margin-left:0cm;mso-list:l2 level1 lfo3">
<span lang="EN-US">This uses LTTng C-API to destroy session<o:p></o:p></span></li></ul>
</td>
<td width="230" valign="top" style="width:172.2pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US">…../uid/500/32-bit </span><span lang="EN-US" style="font-family:Wingdings">à</span><span lang="EN-US"> has metadata but the logs were cleared<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><i><span lang="EN-US">Most times, this also happens:<o:p></o:p></span></i></p>
<p class="MsoNormal"><span lang="EN-US">…../uid/0/32-bit </span><span lang="EN-US" style="font-family:Wingdings">à</span><span lang="EN-US"> has metadata but no trace logs<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</td>
<td width="245" valign="top" style="width:183.75pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><img width="159" height="107" style="width:1.6562in;height:1.1145in" id="Picture_x0020_2" src="cid:image003.png@01D572F1.6F791A30" alt="cid:image001.png@01D56F9D.AF158770"><o:p></o:p></p>
</td>
<td width="662" valign="top" style="width:496.65pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US">The logs are cleared when ‘lttng destroy sess’ is called via the LTTng C-API. From my understanding, this should
<b>not </b>happen.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Destroying the daemon from command line behaves properly. From my understanding, this should be practically the exact same command.<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="156" valign="top" style="width:116.85pt;background:#F2F2F2;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><b><span lang="EN-US" style="color:black">3</span></b><b><span lang="EN-US"><o:p></o:p></span></b></p>
</td>
<td width="230" valign="top" style="width:172.2pt;background:#F2F2F2;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="DE" style="color:#1F4E79">root@device: daemon<o:p></o:p></span></p>
<p class="MsoNormal"><u><span lang="DE" style="color:#1F4E79"><o:p><span style="text-decoration:none"> </span></o:p></span></u></p>
<p class="MsoNormal"><span lang="DE" style="color:#1F4E79">(launching via command-line)<o:p></o:p></span></p>
</td>
<td width="230" valign="top" style="width:172.2pt;background:#F2F2F2;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="color:black">When daemon is killed or session is stopped:
<i>mimics case 1</i></span><i><span lang="EN-US"><o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span lang="EN-US"><o:p> </o:p></span></i></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">When daemon is alive:</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">…./uid/0/32-bit </span>
<span lang="EN-US" style="font-family:Wingdings;color:black">à</span><span lang="EN-US" style="color:black"> has trace logs but empty metadata</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">…./uid/500/32-bit </span>
<span lang="EN-US" style="font-family:Wingdings;color:black">à</span><span lang="EN-US" style="color:black"> has metadata but empty trace logs</span><span lang="EN-US"><o:p></o:p></span></p>
</td>
<td width="245" valign="top" style="width:183.75pt;background:#F2F2F2;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span style="color:black"><img width="192" height="170" style="width:2.0in;height:1.7708in" id="Picture_x0020_5" src="cid:image004.png@01D572F1.6F791A30" alt="cid:image002.png@01D56F9D.AF158770"></span><span lang="EN-US"><o:p></o:p></span></p>
</td>
<td width="662" valign="top" style="width:496.65pt;background:#F2F2F2;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Is this use-case supported?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Unfortunately, the logs are huge and contain sensitive information. If they can help a substantial amount, I can prune them.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks and best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Zach<o:p></o:p></span></p>
</div>
</body>
</html>