Re: [PATCH 1/4] trace-cmd: Add internal API to check if tsc2nsec is supported

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 29 Mar 2021 15:58:18 +0300
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote:

> 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);

Return is not a function, no need for the external parenthesis.

-- Steve

> +}
> +
>  static void parse_record_options(int argc,
>  				 char **argv,
>  				 enum trace_cmd curr_cmd,




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux