* [ltt-dev] [UST PATCH] Include trace name in output directory name
@ 2010-11-08 15:34 Nils Carlson
2010-11-09 16:37 ` David Goulet
0 siblings, 1 reply; 4+ messages in thread
From: Nils Carlson @ 2010-11-08 15:34 UTC (permalink / raw)
Include the name of the trace to the output directory created by
ustd. Yet another part of multi-session support.
Signed-off-by: Nils Carlson <nils.carlson at ericsson.com>
---
ustd/ustd.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/ustd/ustd.c b/ustd/ustd.c
index e75fd9d..3f63457 100644
--- a/ustd/ustd.c
+++ b/ustd/ustd.c
@@ -191,9 +191,9 @@ int on_open_buffer(struct libustd_callbacks *data, struct buffer_info *buf)
trace_path = USTD_DEFAULT_TRACE_PATH;
}
- if (asprintf(&tmp, "%s/%u_%lld", trace_path, buf->pid, buf->pidunique) < 0) {
- ERR("on_open_buffer : asprintf failed (%s/%u_%lld)",
- trace_path, buf->pid, buf->pidunique);
+ if (asprintf(&tmp, "%s/%u_%s_%lld", trace_path, buf->pid, buf->trace, buf->pidunique) < 0) {
+ ERR("on_open_buffer : asprintf failed (%s/%u_%s_%lld)",
+ trace_path, buf->pid, buf->trace, buf->pidunique);
return 1;
}
result = create_dir_if_needed(tmp);
@@ -204,9 +204,9 @@ int on_open_buffer(struct libustd_callbacks *data, struct buffer_info *buf)
}
free(tmp);
- if (asprintf(&tmp, "%s/%u_%lld/%s", trace_path, buf->pid, buf->pidunique, buf->name) < 0) {
- ERR("on_open_buffer : asprintf failed (%s/%u_%lld/%s)",
- trace_path, buf->pid, buf->pidunique, buf->name);
+ if (asprintf(&tmp, "%s/%u_%s_%lld/%s", trace_path, buf->pid, buf->trace, buf->pidunique, buf->name) < 0) {
+ ERR("on_open_buffer : asprintf failed (%s/%u_%s_%lld/%s)",
+ trace_path, buf->pid, buf->trace, buf->pidunique, buf->name);
return 1;
}
result = fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 00600);
--
1.7.1
^ permalink raw reply [flat|nested] 4+ messages in thread* [ltt-dev] [UST PATCH] Include trace name in output directory name
2010-11-08 15:34 [ltt-dev] [UST PATCH] Include trace name in output directory name Nils Carlson
@ 2010-11-09 16:37 ` David Goulet
2010-11-09 18:01 ` Nils Carlson
0 siblings, 1 reply; 4+ messages in thread
From: David Goulet @ 2010-11-09 16:37 UTC (permalink / raw)
How about we put the trace name in front and don't have the PID as the
first value and STOP having multiple traces beginning with numbers that
make things quite confusing in a long term and painful to identify the
good trace ?
David
On 10-11-08 10:34 AM, Nils Carlson wrote:
> Include the name of the trace to the output directory created by
> ustd. Yet another part of multi-session support.
>
> Signed-off-by: Nils Carlson<nils.carlson at ericsson.com>
> ---
> ustd/ustd.c | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/ustd/ustd.c b/ustd/ustd.c
> index e75fd9d..3f63457 100644
> --- a/ustd/ustd.c
> +++ b/ustd/ustd.c
> @@ -191,9 +191,9 @@ int on_open_buffer(struct libustd_callbacks *data, struct buffer_info *buf)
> trace_path = USTD_DEFAULT_TRACE_PATH;
> }
>
> - if (asprintf(&tmp, "%s/%u_%lld", trace_path, buf->pid, buf->pidunique)< 0) {
> - ERR("on_open_buffer : asprintf failed (%s/%u_%lld)",
> - trace_path, buf->pid, buf->pidunique);
> + if (asprintf(&tmp, "%s/%u_%s_%lld", trace_path, buf->pid, buf->trace, buf->pidunique)< 0) {
> + ERR("on_open_buffer : asprintf failed (%s/%u_%s_%lld)",
> + trace_path, buf->pid, buf->trace, buf->pidunique);
> return 1;
> }
> result = create_dir_if_needed(tmp);
> @@ -204,9 +204,9 @@ int on_open_buffer(struct libustd_callbacks *data, struct buffer_info *buf)
> }
> free(tmp);
>
> - if (asprintf(&tmp, "%s/%u_%lld/%s", trace_path, buf->pid, buf->pidunique, buf->name)< 0) {
> - ERR("on_open_buffer : asprintf failed (%s/%u_%lld/%s)",
> - trace_path, buf->pid, buf->pidunique, buf->name);
> + if (asprintf(&tmp, "%s/%u_%s_%lld/%s", trace_path, buf->pid, buf->trace, buf->pidunique, buf->name)< 0) {
> + ERR("on_open_buffer : asprintf failed (%s/%u_%s_%lld/%s)",
> + trace_path, buf->pid, buf->trace, buf->pidunique, buf->name);
> return 1;
> }
> result = fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 00600);
--
David Goulet
LTTng project, DORSAL Lab.
PGP/GPG : 1024D/16BD8563
BE3C 672B 9331 9796 291A 14C6 4AF7 C14B 16BD 8563
^ permalink raw reply [flat|nested] 4+ messages in thread* [ltt-dev] [UST PATCH] Include trace name in output directory name
2010-11-09 16:37 ` David Goulet
@ 2010-11-09 18:01 ` Nils Carlson
2010-11-09 19:17 ` David Goulet
0 siblings, 1 reply; 4+ messages in thread
From: Nils Carlson @ 2010-11-09 18:01 UTC (permalink / raw)
On Nov 9, 2010, at 5:37 PM, David Goulet wrote:
> How about we put the trace name in front and don't have the PID as
> the first value and STOP having multiple traces beginning with
> numbers that make things quite confusing in a long term and painful
> to identify the good trace ?
>
Yep, maybe it's best to really do something about the order...
What about doing date prefixing followed by the trace name and if
necessary followed by a seq nr?
Something like
20101109-152301-auto
20101109-152301-auto_1 (in case of collision?)
We might also consider putting the actual application name (the first
stripped token of argv[0] in there?
/Nils
> David
>
> On 10-11-08 10:34 AM, Nils Carlson wrote:
>> Include the name of the trace to the output directory created by
>> ustd. Yet another part of multi-session support.
>>
>> Signed-off-by: Nils Carlson<nils.carlson at ericsson.com>
>> ---
>> ustd/ustd.c | 12 ++++++------
>> 1 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/ustd/ustd.c b/ustd/ustd.c
>> index e75fd9d..3f63457 100644
>> --- a/ustd/ustd.c
>> +++ b/ustd/ustd.c
>> @@ -191,9 +191,9 @@ int on_open_buffer(struct libustd_callbacks
>> *data, struct buffer_info *buf)
>> trace_path = USTD_DEFAULT_TRACE_PATH;
>> }
>>
>> - if (asprintf(&tmp, "%s/%u_%lld", trace_path, buf->pid, buf-
>> >pidunique)< 0) {
>> - ERR("on_open_buffer : asprintf failed (%s/%u_%lld)",
>> - trace_path, buf->pid, buf->pidunique);
>> + if (asprintf(&tmp, "%s/%u_%s_%lld", trace_path, buf->pid, buf-
>> >trace, buf->pidunique)< 0) {
>> + ERR("on_open_buffer : asprintf failed (%s/%u_%s_%lld)",
>> + trace_path, buf->pid, buf->trace, buf->pidunique);
>> return 1;
>> }
>> result = create_dir_if_needed(tmp);
>> @@ -204,9 +204,9 @@ int on_open_buffer(struct libustd_callbacks
>> *data, struct buffer_info *buf)
>> }
>> free(tmp);
>>
>> - if (asprintf(&tmp, "%s/%u_%lld/%s", trace_path, buf->pid, buf-
>> >pidunique, buf->name)< 0) {
>> - ERR("on_open_buffer : asprintf failed (%s/%u_%lld/%s)",
>> - trace_path, buf->pid, buf->pidunique, buf->name);
>> + if (asprintf(&tmp, "%s/%u_%s_%lld/%s", trace_path, buf->pid, buf-
>> >trace, buf->pidunique, buf->name)< 0) {
>> + ERR("on_open_buffer : asprintf failed (%s/%u_%s_%lld/%s)",
>> + trace_path, buf->pid, buf->trace, buf->pidunique, buf->name);
>> return 1;
>> }
>> result = fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL,
>> 00600);
>
> --
> David Goulet
> LTTng project, DORSAL Lab.
>
> PGP/GPG : 1024D/16BD8563
> BE3C 672B 9331 9796 291A 14C6 4AF7 C14B 16BD 8563
>
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
^ permalink raw reply [flat|nested] 4+ messages in thread* [ltt-dev] [UST PATCH] Include trace name in output directory name
2010-11-09 18:01 ` Nils Carlson
@ 2010-11-09 19:17 ` David Goulet
0 siblings, 0 replies; 4+ messages in thread
From: David Goulet @ 2010-11-09 19:17 UTC (permalink / raw)
On 10-11-09 01:01 PM, Nils Carlson wrote:
>
> On Nov 9, 2010, at 5:37 PM, David Goulet wrote:
>
>> How about we put the trace name in front and don't have the PID as the
>> first value and STOP having multiple traces beginning with numbers
>> that make things quite confusing in a long term and painful to
>> identify the good trace ?
>>
>
> Yep, maybe it's best to really do something about the order...
>
> What about doing date prefixing followed by the trace name and if
> necessary followed by a seq nr?
>
> Something like
>
> 20101109-152301-auto
> 20101109-152301-auto_1 (in case of collision?)
>
> We might also consider putting the actual application name (the first
> stripped token of argv[0] in there?
Hmmm, there is a lot of information in these path for now lol.
usttrace should also be consider for a change I think. It is unusable to
my opinion having this date format of 24 numbers... and only numbers
that in a long run become human "not readable".
So how about this :
${HOME}/.usttraces/$hostname-$app_name/20101109-152301-$tracename-$PID
Regrouping all traces from the same apps and host.. ?
David
>
> /Nils
>
>
>
>> David
>>
>> On 10-11-08 10:34 AM, Nils Carlson wrote:
>>> Include the name of the trace to the output directory created by
>>> ustd. Yet another part of multi-session support.
>>>
>>> Signed-off-by: Nils Carlson<nils.carlson at ericsson.com>
>>> ---
>>> ustd/ustd.c | 12 ++++++------
>>> 1 files changed, 6 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/ustd/ustd.c b/ustd/ustd.c
>>> index e75fd9d..3f63457 100644
>>> --- a/ustd/ustd.c
>>> +++ b/ustd/ustd.c
>>> @@ -191,9 +191,9 @@ int on_open_buffer(struct libustd_callbacks
>>> *data, struct buffer_info *buf)
>>> trace_path = USTD_DEFAULT_TRACE_PATH;
>>> }
>>>
>>> - if (asprintf(&tmp, "%s/%u_%lld", trace_path, buf->pid,
>>> buf->pidunique)< 0) {
>>> - ERR("on_open_buffer : asprintf failed (%s/%u_%lld)",
>>> - trace_path, buf->pid, buf->pidunique);
>>> + if (asprintf(&tmp, "%s/%u_%s_%lld", trace_path, buf->pid,
>>> buf->trace, buf->pidunique)< 0) {
>>> + ERR("on_open_buffer : asprintf failed (%s/%u_%s_%lld)",
>>> + trace_path, buf->pid, buf->trace, buf->pidunique);
>>> return 1;
>>> }
>>> result = create_dir_if_needed(tmp);
>>> @@ -204,9 +204,9 @@ int on_open_buffer(struct libustd_callbacks
>>> *data, struct buffer_info *buf)
>>> }
>>> free(tmp);
>>>
>>> - if (asprintf(&tmp, "%s/%u_%lld/%s", trace_path, buf->pid,
>>> buf->pidunique, buf->name)< 0) {
>>> - ERR("on_open_buffer : asprintf failed (%s/%u_%lld/%s)",
>>> - trace_path, buf->pid, buf->pidunique, buf->name);
>>> + if (asprintf(&tmp, "%s/%u_%s_%lld/%s", trace_path, buf->pid,
>>> buf->trace, buf->pidunique, buf->name)< 0) {
>>> + ERR("on_open_buffer : asprintf failed (%s/%u_%s_%lld/%s)",
>>> + trace_path, buf->pid, buf->trace, buf->pidunique, buf->name);
>>> return 1;
>>> }
>>> result = fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 00600);
>>
>> --
>> David Goulet
>> LTTng project, DORSAL Lab.
>>
>> PGP/GPG : 1024D/16BD8563
>> BE3C 672B 9331 9796 291A 14C6 4AF7 C14B 16BD 8563
>>
>> _______________________________________________
>> ltt-dev mailing list
>> ltt-dev at lists.casi.polymtl.ca
>> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>
--
David Goulet
LTTng project, DORSAL Lab.
PGP/GPG : 1024D/16BD8563
BE3C 672B 9331 9796 291A 14C6 4AF7 C14B 16BD 8563
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-09 19:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-08 15:34 [ltt-dev] [UST PATCH] Include trace name in output directory name Nils Carlson
2010-11-09 16:37 ` David Goulet
2010-11-09 18:01 ` Nils Carlson
2010-11-09 19:17 ` David Goulet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox