Patch "perf trace: Add a strtoul() method to 'struct syscall_arg_fmt'" has been added to the 5.4-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    perf trace: Add a strtoul() method to 'struct syscall_arg_fmt'

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-trace-add-a-strtoul-method-to-struct-syscall_ar.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2024793dba037c184d0e53f48426b08e0f86efa6
Author: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Date:   Wed Oct 9 16:06:43 2019 -0300

    perf trace: Add a strtoul() method to 'struct syscall_arg_fmt'
    
    [ Upstream commit 3f41b77843b338e836f52cc2d486be689d6cb9c1 ]
    
    This will go from a string to a number, so that filter expressions can
    be constructed with strings and then, before applying the tracepoint
    filters (or eBPF, in the future) we can map those strings to numbers.
    
    The first one will be for 'msr' tracepoint arguments, but real quickly
    we will be able to reuse all strarrays for that.
    
    Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
    Cc: Brendan Gregg <brendan.d.gregg@xxxxxxxxx>
    Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
    Cc: Luis Cláudio Gonçalves <lclaudio@xxxxxxxxxx>
    Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
    Link: https://lkml.kernel.org/n/tip-wgqq48agcgr95b8dmn6fygtr@xxxxxxxxxxxxxx
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
    Stable-dep-of: 03e9a5d8eb55 ("perf trace: Handle failure when trace point folder is missed")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 02cf39970ed0..4cb3252623f5 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -86,8 +86,12 @@
 # define F_LINUX_SPECIFIC_BASE	1024
 #endif
 
+/*
+ * strtoul: Go from a string to a value, i.e. for msr: MSR_FS_BASE to 0xc0000100
+ */
 struct syscall_arg_fmt {
 	size_t	   (*scnprintf)(char *bf, size_t size, struct syscall_arg *arg);
+	bool	   (*strtoul)(char *bf, size_t size, struct syscall_arg *arg, u64 *val);
 	unsigned long (*mask_val)(struct syscall_arg *arg, unsigned long val);
 	void	   *parm;
 	const char *name;
@@ -1515,8 +1519,10 @@ syscall_arg_fmt__init_array(struct syscall_arg_fmt *arg, struct tep_format_field
                } else {
 			struct syscall_arg_fmt *fmt = syscall_arg_fmt__find_by_name(field->name);
 
-			if (fmt)
+			if (fmt) {
 				arg->scnprintf = fmt->scnprintf;
+				arg->strtoul   = fmt->strtoul;
+			}
 		}
 	}
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux