projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
text output: wire up clock options, error checking
[babeltrace.git]
/
plugins
/
text
/
print.c
diff --git
a/plugins/text/print.c
b/plugins/text/print.c
index 97c526ff71bde0a139d8d0dac0a351ec120e3d53..b227e399d219fa9510c16cd558822f995d95d05c 100644
(file)
--- a/
plugins/text/print.c
+++ b/
plugins/text/print.c
@@
-4,6
+4,7
@@
* Babeltrace CTF Text Output Plugin Event Printing
*
* Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
* Babeltrace CTF Text Output Plugin Event Printing
*
* Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
@@
-136,7
+137,7
@@
void print_timestamp_wall(struct text_component *text,
ts_nsec_abs = -ts_nsec;
}
ts_nsec_abs = -ts_nsec;
}
- if (
/*!opt_clock_seconds*/true
) {
+ if (
!text->options.clock_seconds
) {
struct tm tm;
time_t time_s = (time_t) ts_sec_abs;
struct tm tm;
time_t time_s = (time_t) ts_sec_abs;
@@
-145,7
+146,7
@@
void print_timestamp_wall(struct text_component *text,
goto seconds;
}
goto seconds;
}
- if (
/*!opt_clock_gmt*/true
) {
+ if (
!text->options.clock_gmt
) {
struct tm *res;
res = localtime_r(&time_s, &tm);
struct tm *res;
res = localtime_r(&time_s, &tm);
@@
-162,7
+163,7
@@
void print_timestamp_wall(struct text_component *text,
goto seconds;
}
}
goto seconds;
}
}
- if (
/*opt_clock_date*/fals
e) {
+ if (
text->options.clock_dat
e) {
char timestr[26];
size_t res;
char timestr[26];
size_t res;
@@
-207,10
+208,21
@@
enum bt_component_status print_event_timestamp(struct text_component *text,
goto end;
}
goto end;
}
- /* FIXME - error checking */
stream_class = bt_ctf_stream_get_class(stream);
stream_class = bt_ctf_stream_get_class(stream);
+ if (!stream_class) {
+ ret = BT_COMPONENT_STATUS_ERROR;
+ goto end;
+ }
trace = bt_ctf_stream_class_get_trace(stream_class);
trace = bt_ctf_stream_class_get_trace(stream_class);
+ if (!trace) {
+ ret = BT_COMPONENT_STATUS_ERROR;
+ goto end;
+ }
clock = bt_ctf_trace_get_clock(trace, 0);
clock = bt_ctf_trace_get_clock(trace, 0);
+ if (!clock) {
+ ret = BT_COMPONENT_STATUS_ERROR;
+ goto end;
+ }
fputs(print_names ? "timestamp = " : "[", out);
if (text->options.print_timestamp_cycles) {
fputs(print_names ? "timestamp = " : "[", out);
if (text->options.print_timestamp_cycles) {
@@
-226,6
+238,9
@@
enum bt_component_status print_event_timestamp(struct text_component *text,
if (!text->options.print_delta_field) {
goto end;
}
if (!text->options.print_delta_field) {
goto end;
}
+
+ //TODO delta
+
end:
bt_put(stream);
bt_put(clock);
end:
bt_put(stream);
bt_put(clock);
This page took
0.03057 seconds
and
4
git commands to generate.