[ltt-dev] [PATCH] Add formated dump module
Vincent Attard
vincent.attard at polymtl.ca
Fri Jan 14 11:02:03 EST 2011
Selon Mathieu Desnoyers <compudj at krystal.dyndns.org>:
> > + /* Switch case:
> > + * all '%-' are replaced by the desired value in 'str' */
> > + char *str_pos = str;
> > + for (i = 0; i < strlen(fmt); i++){
> > + if (fmt[i] == '%'){
> > +
> > + switch (fmt[++i]){
> > + case 't':
> > + str_pos += sprintf(str_pos, "%ldh%02ldm%02lds%09ldns",
> > + time.tv_sec/3600, (time.tv_sec%3600)/60, time.tv_sec%60,
> > + time.tv_nsec);
>
> is it me or this changes the timestamp output format compared to the
> original textDump ?
>
> Thanks,
>
> Mathieu
>
Yes, it changes the output format in -h--m--s---------ns but there is still the
original textDump format. You can write %s.%n (%s for seconds and %n for
nanoseconds) and it gives you the same output format as textDump for the
timestamp.
If you put the option -T instead of -F, it would give you exactly the same
format as textDump. I check it with kdiff and there is no difference.
Best regards,
Vincent Attard
More information about the lttng-dev
mailing list