projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix timestamp parsing
[babeltrace.git]
/
converter
/
babeltrace-log.c
diff --git
a/converter/babeltrace-log.c
b/converter/babeltrace-log.c
index b2935ac9fa488cc3406549df69eebea9cf035c47..711937352eea3c884f774178ad7076aaef05c11e 100644
(file)
--- a/
converter/babeltrace-log.c
+++ b/
converter/babeltrace-log.c
@@
-35,7
+35,7
@@
#include <babeltrace/babeltrace.h>
#include <babeltrace/ctf/types.h>
#include <babeltrace/babeltrace.h>
#include <babeltrace/ctf/types.h>
-#define
N
SEC_PER_SEC 1000000UL
+#define
U
SEC_PER_SEC 1000000UL
#ifndef UUID_STR_LEN
#define UUID_STR_LEN 37 /* With \0 */
#ifndef UUID_STR_LEN
#define UUID_STR_LEN 37 /* With \0 */
@@
-154,7
+154,7
@@
void write_event_header(struct ctf_stream_pos *pos, char *line,
char **tline, size_t len, size_t *tlen,
uint64_t *ts)
{
char **tline, size_t len, size_t *tlen,
uint64_t *ts)
{
- unsigned long sec,
n
sec;
+ unsigned long sec,
u
sec;
int ret;
if (!s_timestamp)
int ret;
if (!s_timestamp)
@@
-163,13
+163,16
@@
void write_event_header(struct ctf_stream_pos *pos, char *line,
/* Only need to be executed on first pass (dummy) */
if (pos->dummy) {
/* Extract time from input line */
/* Only need to be executed on first pass (dummy) */
if (pos->dummy) {
/* Extract time from input line */
- ret = sscanf(line, "[%lu.%lu] ", &sec, &
n
sec);
+ ret = sscanf(line, "[%lu.%lu] ", &sec, &
u
sec);
if (ret == 2) {
*tline = strchr(line, ']');
if (ret == 2) {
*tline = strchr(line, ']');
- if ((*tline)[1] == ' ')
+ assert(*tline);
+ (*tline)++;
+ if ((*tline)[0] == ' ') {
(*tline)++;
(*tline)++;
+ }
*tlen = len + line - *tline;
*tlen = len + line - *tline;
- *ts = (uint64_t) sec *
NSEC_PER_SEC + (uint64_t) n
sec;
+ *ts = (uint64_t) sec *
USEC_PER_SEC + (uint64_t) u
sec;
}
}
/* timestamp */
}
}
/* timestamp */
This page took
0.023537 seconds
and
4
git commands to generate.