Commit 74df5d2
committed
Fix USDT argument parsing for ARM64 bracket syntax with spaces
The CUDA probe arguments on ARM64 use bracket syntax with spaces like
'4@[sp, 44]' but our parser was using strings.Fields() which splits on
all whitespace. This caused the arguments to be incorrectly split into
'4@[sp,' and '44]'.
Add a new splitUSDTArgs() function that preserves spaces inside brackets
while still splitting arguments on whitespace outside brackets. This
correctly handles both x86_64 syntax like '-4@-24(%rbp)' and ARM64 syntax
like '4@[sp, 44]'.
Also add a test case for ARM64 arguments with spaces in brackets.1 parent 8f15ae6 commit 74df5d2
2 files changed
+46
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
283 | 320 | | |
284 | 321 | | |
| 322 | + | |
285 | 323 | | |
286 | 324 | | |
287 | 325 | | |
288 | 326 | | |
289 | 327 | | |
290 | 328 | | |
291 | 329 | | |
292 | | - | |
293 | | - | |
| 330 | + | |
| 331 | + | |
294 | 332 | | |
295 | 333 | | |
296 | 334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
434 | 440 | | |
435 | 441 | | |
436 | 442 | | |
| |||
0 commit comments