app/trace: verify tsc_rate specified in shm is > 0
Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: If60eb51a1a5bad4340eb2ec39a24ad13434e9044
This commit is contained in:
parent
a871d5e5d7
commit
10fd30eb01
@ -378,6 +378,11 @@ int main(int argc, char **argv)
|
||||
g_histories = (struct spdk_trace_histories *)history_ptr;
|
||||
|
||||
tsc_rate = g_histories->tsc_rate;
|
||||
if (tsc_rate == 0) {
|
||||
fprintf(stderr, "Invalid tsc_rate %ju\n", tsc_rate);
|
||||
usage();
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
printf("TSC Rate: %ju\n", tsc_rate);
|
||||
|
Loading…
Reference in New Issue
Block a user