Re: [PATCH v2] libtraceevent: Add __rel_loc relative location attribute support

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

 



On Tue, Nov 23, 2021 at 10:36:18PM +0900, Masami Hiramatsu wrote:
> Add '__rel_loc' new dynamic data location attribute which encodes
> the data location from the next to the field itself. This is similar
> to the '__data_loc' but the location offset is not from the event
> entry but from the next of the field.
> 
> This patch adds '__rel_loc' decoding support in the libtraceevent.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
> ---
>  Changes in v2:
>    - Fix to adjust '*offset' instead of 'offset' in dynamic_offset_field()
> ---
>  src/event-parse.c  |   54 +++++++++++++++++++++++++++++++++-------------------
>  src/event-parse.h  |    5 +++--
>  src/parse-filter.c |    5 ++++-
>  3 files changed, 41 insertions(+), 23 deletions(-)
> 
> diff --git a/src/event-parse.c b/src/event-parse.c
> index 70637586bc9a..a88c73a8d0fb 100644
> --- a/src/event-parse.c
> +++ b/src/event-parse.c

[..]

> @@ -3308,19 +3318,23 @@ process_function(struct tep_event *event, struct tep_print_arg *arg,
>  		free_token(token);
>  		return process_int_array(event, arg, tok);
>  	}
> -	if (strcmp(token, "__get_str") == 0) {
> +	if (strcmp(token, "__get_str") == 0 ||
> +	    strcmp(token, "__get_rel_str") == 0) {

Should user_events use __get_rel_str vs __get_str for the print_fmt?
Both __dyn_loc and __rel_loc use __get_str currently.

Thanks,
-Beau



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

  Powered by Linux