History

tracing/probes: Fix to avoid double count of the string length on the array

If an array is specified with the ustring or symstr, the length of the strings are accumlated on both of 'ret' and 'total', which means the length is double counted. Just set the length to the 'ret' value for avoiding double counting. Link: https://lore.kernel.org/all/168908492917.123124.15076463491122036025.stgit@devnote2/

Masami Hiramatsu (Google) committed 3 years ago

Commit 66bcf651 parent d5f28bb1 file · +2 −2Browse files

Unified · Split

kernel/trace/trace_probe_tmpl.h+2−2
@@ -156,11 +156,11 @@ stage3: · 155 unmodified lines
156 code++;156 code++;
157 goto array;157 goto array;
158 case FETCH_OP_ST_USTRING:158 case FETCH_OP_ST_USTRING:
159 ret += fetch_store_strlen_user(val + code->offset);159 ret = fetch_store_strlen_user(val + code->offset);
160 code++;160 code++;
161 goto array;161 goto array;
162 case FETCH_OP_ST_SYMSTR:162 case FETCH_OP_ST_SYMSTR:
163 ret += fetch_store_symstrlen(val + code->offset);163 ret = fetch_store_symstrlen(val + code->offset);
164 code++;164 code++;
165 goto array;165 goto array;
166 default:166 default:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t