A new internal API is added to check is tsc to nanoseconds conversion is supported: bool trace_tsc2nsec_is_supported(void); Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx> --- tracecmd/include/trace-local.h | 2 ++ tracecmd/trace-record.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/tracecmd/include/trace-local.h b/tracecmd/include/trace-local.h index 7773e9fc..6a4c5f51 100644 --- a/tracecmd/include/trace-local.h +++ b/tracecmd/include/trace-local.h @@ -341,4 +341,6 @@ static inline bool is_digits(const char *s) return true; } +bool trace_tsc2nsec_is_supported(void); + #endif /* __TRACE_LOCAL_H */ diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c index 5e69cf48..5c9d800f 100644 --- a/tracecmd/trace-record.c +++ b/tracecmd/trace-record.c @@ -5827,6 +5827,11 @@ static int get_tsc_nsec(int *shift, int *mult) } #endif +bool trace_tsc2nsec_is_supported(void) +{ + return (get_tsc_nsec(NULL, NULL) == 0); +} + static void parse_record_options(int argc, char **argv, enum trace_cmd curr_cmd, -- 2.30.2