- Added seconds.nanosecond output format for time
- Converted to comply with time stamps comparable on each CPU
- Fix oops on tracing dm/md and other stacked devices
+ - Always make sure we stop the trace properly
20050830:
- Added argument parsing
- Added action mask set up
static char *buts_name_p;
static char *dev;
static int act_mask = ~0;
+static int trace_started;
inline int compare_mask_map(struct mask_map *mmp, char *string)
{
return 1;
}
+ trace_started = 1;
buts_name_p = strdup(buts.name);
return 0;
}
done = 1;
}
+void stop_trace_on_exit(void)
+{
+ if (trace_started)
+ stop_trace();
+}
+
int main(int argc, char *argv[])
{
struct stat st;
if (start_trace(dev)) {
fprintf(stderr, "Failed to start trace on %s\n", dev);
- stop_trace();
return 3;
}
signal(SIGHUP, handle_sigint);
signal(SIGTERM, handle_sigint);
+ atexit(stop_trace_on_exit);
+
while (!is_done())
sleep(1);