Re: [PATCH 2/2] tracing: Fix reading strings from synthetic events

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

 



On Tue, 11 Oct 2022 17:25:03 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> @@ -417,19 +420,28 @@ static unsigned int trace_string(struct synth_trace_event *entry,
>  		data_offset += event->n_u64 * sizeof(u64);
>  		data_offset += data_size;
>  
> -		str_field = (char *)entry + data_offset;
> -
> -		len = strlen(str_val) + 1;
> -		strscpy(str_field, str_val, len);
> -
> +		len = kern_fetch_store_strlen(str_val) + 1;
> +		if (len == 1)
> +			len = strlen("fault") + 1;
>  		data_offset |= len << 16;
>  		*(u32 *)&entry->fields[*n_u64] = data_offset;
>  
> +		kern_fetch_store_string((unsigned long)str_val, &entry->fields[*n_u64], entry);
> +

This isn't working quite right on faults. I'll be sending a v2 later.

-- Steve



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux