mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
tracing/probes: Extend max length of argument string
To support BTF argument parsing (such as accessing fields within nested structures via typecasting), the maximum argument string length needs to be extended. Extend MAX_ARGSTR_LEN from 63 to 255. Since MAX_ARGSTR_LEN was previously reused to format command heads in trace_*probe_match_command_head() functions, introduce a dedicated MAX_COMMON_HEAD_LEN (63) macro for matching command heads and switch these functions to use the new macro. Link: https://lore.kernel.org/all/178399140457.27810.11387684872148824707.stgit@devnote2/ Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
This commit is contained in:
committed by
Masami Hiramatsu (Google)
parent
0b420da72e
commit
47e4ec6871
@@ -238,7 +238,7 @@ static bool trace_fprobe_is_busy(struct dyn_event *ev)
|
||||
static bool trace_fprobe_match_command_head(struct trace_fprobe *tf,
|
||||
int argc, const char **argv)
|
||||
{
|
||||
char buf[MAX_ARGSTR_LEN + 1];
|
||||
char buf[MAX_COMMON_HEAD_LEN + 1];
|
||||
|
||||
if (!argc)
|
||||
return true;
|
||||
|
||||
@@ -149,7 +149,7 @@ static bool trace_kprobe_is_busy(struct dyn_event *ev)
|
||||
static bool trace_kprobe_match_command_head(struct trace_kprobe *tk,
|
||||
int argc, const char **argv)
|
||||
{
|
||||
char buf[MAX_ARGSTR_LEN + 1];
|
||||
char buf[MAX_COMMON_HEAD_LEN + 1];
|
||||
|
||||
if (!argc)
|
||||
return true;
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
#include "trace_output.h"
|
||||
|
||||
#define MAX_TRACE_ARGS 128
|
||||
#define MAX_ARGSTR_LEN 63
|
||||
#define MAX_ARGSTR_LEN 255
|
||||
#define MAX_COMMON_HEAD_LEN 63
|
||||
#define MAX_ARRAY_LEN 64
|
||||
#define MAX_ARG_NAME_LEN 32
|
||||
#define MAX_BTF_ARGS_LEN 128
|
||||
|
||||
@@ -281,7 +281,7 @@ static bool trace_uprobe_is_busy(struct dyn_event *ev)
|
||||
static bool trace_uprobe_match_command_head(struct trace_uprobe *tu,
|
||||
int argc, const char **argv)
|
||||
{
|
||||
char buf[MAX_ARGSTR_LEN + 1];
|
||||
char buf[MAX_COMMON_HEAD_LEN + 1];
|
||||
int len;
|
||||
|
||||
if (!argc)
|
||||
|
||||
@@ -75,7 +75,7 @@ check_error 'f vfs_read ^arg123456789012345678901234567890=@11' # ARG_NAME_TOO_L
|
||||
check_error 'f vfs_read ^=@11' # NO_ARG_NAME
|
||||
check_error 'f vfs_read ^var.1=@11' # BAD_ARG_NAME
|
||||
check_error 'f vfs_read var1=@11 ^var1=@12' # USED_ARG_NAME
|
||||
check_error 'f vfs_read ^+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(@1234))))))' # ARG_TOO_LONG
|
||||
check_error 'f vfs_read ^+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(@1234))))))))))))))))))))))))))' # ARG_TOO_LONG
|
||||
check_error 'f vfs_read arg1=^' # NO_ARG_BODY
|
||||
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ check_error 't kfree ^arg123456789012345678901234567890=@11' # ARG_NAME_TOO_LOG
|
||||
check_error 't kfree ^=@11' # NO_ARG_NAME
|
||||
check_error 't kfree ^var.1=@11' # BAD_ARG_NAME
|
||||
check_error 't kfree var1=@11 ^var1=@12' # USED_ARG_NAME
|
||||
check_error 't kfree ^+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(@1234))))))' # ARG_TOO_LONG
|
||||
check_error 't kfree ^+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(@1234))))))))))))))))))))))))))' # ARG_TOO_LONG
|
||||
check_error 't kfree arg1=^' # NO_ARG_BODY
|
||||
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ check_error 'p vfs_read ^arg123456789012345678901234567890=@11' # ARG_NAME_TOO_L
|
||||
check_error 'p vfs_read ^=@11' # NO_ARG_NAME
|
||||
check_error 'p vfs_read ^var.1=@11' # BAD_ARG_NAME
|
||||
check_error 'p vfs_read var1=@11 ^var1=@12' # USED_ARG_NAME
|
||||
check_error 'p vfs_read ^+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(@1234))))))' # ARG_TOO_LONG
|
||||
check_error 'p vfs_read ^+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(+1234567(@1234))))))))))))))))))))))))))' # ARG_TOO_LONG
|
||||
check_error 'p vfs_read arg1=^' # NO_ARG_BODY
|
||||
|
||||
# instruction boundary check is valid on x86 (at this moment)
|
||||
|
||||
Reference in New Issue
Block a user