]> git.baikalelectronics.ru Git - kernel.git/commitdiff
perf trace: Separate 'struct syscall_fmt' definition from syscall_fmts variable
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 1 Oct 2019 18:16:33 +0000 (15:16 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:27 +0000 (11:41 +0100)
[ Upstream commit 701dbc70b22bcb507f194ecc6d8cdd405848d635 ]

As this has all the things needed to format tracepoints events, not just
syscalls, that, after all, are just tracepoints with a set in stone ABI,
i.e. order and number of parameters.

For tracepoints we'll create a

  static struct syscall_fmt tracepoint_fmts[]

array and will fill the ->arg[] entries with the beautifier for each
positional argument and record the name, then, when we need it, we'll
just check that the position has the same name, maybe even type, so that
we can do some check that the tracepoint hasn't changed, if it has, we
can even reorder things.

Keep calling it syscall_fmt but use it as well for tracepoints, do it
this way to minimize changes and reuse what is in place for syscalls,
we'll see.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-2x1jgiev13zt4njaanlnne0d@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Stable-dep-of: 03e9a5d8eb55 ("perf trace: Handle failure when trace point folder is missed")
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/builtin-trace.c

index d333f6c86c98af90c35426d0c358deddd54a8dd3..5dc8b123d3f53be350a51f3c8353799e5688a861 100644 (file)
@@ -702,7 +702,7 @@ struct syscall_arg_fmt {
        bool       show_zero;
 };
 
-static struct syscall_fmt {
+struct syscall_fmt {
        const char *name;
        const char *alias;
        struct {
@@ -714,7 +714,9 @@ static struct syscall_fmt {
        bool       errpid;
        bool       timeout;
        bool       hexret;
-} syscall_fmts[] = {
+};
+
+static struct syscall_fmt syscall_fmts[] = {
        { .name     = "access",
          .arg = { [1] = { .scnprintf = SCA_ACCMODE,  /* mode */ }, }, },
        { .name     = "arch_prctl",