Re: [PATCH 2/6] trace-cmd library: Add new API to get file version of input handler

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

 



On Thu, 22 Apr 2021 10:17:14 +0300
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote:

> Added an API to get the version of the trace file, associated with given
> input file handler.
>   tracecmd_get_file_version()
> 
> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx>
> ---
>  lib/trace-cmd/include/private/trace-cmd-private.h | 2 ++
>  lib/trace-cmd/trace-input.c                       | 9 +++++++++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/lib/trace-cmd/include/private/trace-cmd-private.h b/lib/trace-cmd/include/private/trace-cmd-private.h
> index dccd8ae5..fa5b8880 100644
> --- a/lib/trace-cmd/include/private/trace-cmd-private.h
> +++ b/lib/trace-cmd/include/private/trace-cmd-private.h
> @@ -232,6 +232,8 @@ int tracecmd_set_cursor(struct tracecmd_input *handle,
>  unsigned long long
>  tracecmd_get_cursor(struct tracecmd_input *handle, int cpu);
>  
> +unsigned long tracecmd_get_file_version(struct tracecmd_input *handle);
> +
>  int tracecmd_ftrace_overrides(struct tracecmd_input *handle, struct tracecmd_ftrace *finfo);
>  bool tracecmd_get_use_trace_clock(struct tracecmd_input *handle);
>  tracecmd_show_data_func
> diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
> index a00fa982..b2a03ab8 100644
> --- a/lib/trace-cmd/trace-input.c
> +++ b/lib/trace-cmd/trace-input.c
> @@ -4034,6 +4034,15 @@ struct tep_handle *tracecmd_get_tep(struct tracecmd_input *handle)
>  	return handle->pevent;
>  }
>  
> +/**
> + * tracecmd_get_file_version - return the trace.dat file version
> + * @handle: input handle for the trace.dat file
> + */
> +unsigned long tracecmd_get_file_version(struct tracecmd_input *handle)
> +{
> +	return handle->file_version;
> +}

This patch doesn't build:

trace-input.c: In function ‘tracecmd_get_file_version’:
trace-input.c:4033:15: error: ‘struct tracecmd_input’ has no member named ‘file_version’
 4033 |  return handle->file_version;
      |               ^~
trace-input.c:4034:1: warning: control reaches end of non-void function [-Wreturn-type]
 4034 | }
      | ^


-- Steve

> +
>  /**
>   * tracecmd_get_use_trace_clock - return use_trace_clock
>   * @handle: input handle for the trace.dat file




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

  Powered by Linux