diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2009-11-20 15:21:14 -0500 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2009-11-20 15:24:36 -0500 |
| commit | 6a76b75a7cb2b9a7a8c867c2cd3df683fe93425e (patch) | |
| tree | 4510b8bf61969fed4b9f88de854b598a7b7d6431 | |
| parent | e37cc922f4a9630f9306f0825270f5d7e91c0f0f (diff) | |
reset max latency
When running one of the latency tracers, reset the max latency.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| -rw-r--r-- | trace-cmd.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/trace-cmd.c b/trace-cmd.c index 77ce277..9e69aee 100644 --- a/trace-cmd.c +++ b/trace-cmd.c | |||
| @@ -519,6 +519,21 @@ static void disable_all(void) | |||
| 519 | fclose(fp); | 519 | fclose(fp); |
| 520 | } | 520 | } |
| 521 | 521 | ||
| 522 | static void reset_max_latency(void) | ||
| 523 | { | ||
| 524 | FILE *fp; | ||
| 525 | char *path; | ||
| 526 | |||
| 527 | /* reset the trace */ | ||
| 528 | path = get_tracing_file("tracing_max_latency"); | ||
| 529 | fp = fopen(path, "w"); | ||
| 530 | if (!fp) | ||
| 531 | die("writing to '%s'", path); | ||
| 532 | put_tracing_file(path); | ||
| 533 | fwrite("0", 1, 1, fp); | ||
| 534 | fclose(fp); | ||
| 535 | } | ||
| 536 | |||
| 522 | static void enable_events(void) | 537 | static void enable_events(void) |
| 523 | { | 538 | { |
| 524 | struct event_list *event; | 539 | struct event_list *event; |
| @@ -1233,6 +1248,7 @@ int main (int argc, char **argv) | |||
| 1233 | strcmp(plugin, "wakeup_rt") == 0) { | 1248 | strcmp(plugin, "wakeup_rt") == 0) { |
| 1234 | latency = 1; | 1249 | latency = 1; |
| 1235 | stop_threads(); | 1250 | stop_threads(); |
| 1251 | reset_max_latency(); | ||
| 1236 | } | 1252 | } |
| 1237 | if (fset < 0 && (strcmp(plugin, "function") == 0 || | 1253 | if (fset < 0 && (strcmp(plugin, "function") == 0 || |
| 1238 | strcmp(plugin, "function_graph") == 0)) | 1254 | strcmp(plugin, "function_graph") == 0)) |
