To hide the first dummy 'data' argument on the tracepoint probe events,
the BTF argument array was modified (skip the first argument for tracepoint),
but the '$arg*' meta argument parser missed that.
Fix to increment the argument index if it is tracepoint probe. And decrement
the index when searching the type of the argument.
Link: https://lore.kernel.org/all/168657113778.3038017.12245893750241701312.stgit@mhiramat.roam.corp.google.com/
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
 
                if (name && !strcmp(name, varname)) {
                        code->op = FETCH_OP_ARG;
-                       code->param = i;
+                       if (ctx->flags & TPARG_FL_TPOINT)
+                               code->param = i + 1;
+                       else
+                               code->param = i;
                        return 0;
                }
        }
        struct btf *btf = traceprobe_get_btf();
        const char *typestr = NULL;
 
-       if (btf && ctx->params)
+       if (btf && ctx->params) {
+               if (ctx->flags & TPARG_FL_TPOINT)
+                       arg_idx--;
                typestr = type_from_btf_id(btf, ctx->params[arg_idx].type);
+       }
 
        return find_fetch_type(typestr, ctx->flags);
 }