Commit 90b2c21
perf parse-events: Avoid copying an empty list
In parse_events_add_pmu, delay copying the list of terms until it is
known the list contains terms.
Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Tested-by: Atish Patra <atishp@rivosinc.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Beeman Strong <beeman@rivosinc.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240416061533.921723-4-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>1 parent 63dfcde commit 90b2c21
1 file changed
+13
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1398 | 1398 | | |
1399 | 1399 | | |
1400 | 1400 | | |
1401 | | - | |
1402 | | - | |
1403 | | - | |
1404 | | - | |
1405 | | - | |
1406 | | - | |
1407 | | - | |
1408 | | - | |
1409 | 1401 | | |
1410 | 1402 | | |
1411 | 1403 | | |
1412 | 1404 | | |
1413 | | - | |
| 1405 | + | |
| 1406 | + | |
1414 | 1407 | | |
1415 | 1408 | | |
1416 | 1409 | | |
1417 | | - | |
| 1410 | + | |
1418 | 1411 | | |
1419 | 1412 | | |
1420 | 1413 | | |
1421 | 1414 | | |
1422 | 1415 | | |
1423 | | - | |
1424 | 1416 | | |
1425 | 1417 | | |
1426 | 1418 | | |
1427 | 1419 | | |
1428 | 1420 | | |
1429 | 1421 | | |
1430 | 1422 | | |
1431 | | - | |
| 1423 | + | |
1432 | 1424 | | |
1433 | 1425 | | |
1434 | 1426 | | |
| |||
1437 | 1429 | | |
1438 | 1430 | | |
1439 | 1431 | | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
1440 | 1441 | | |
1441 | 1442 | | |
1442 | 1443 | | |
| |||
0 commit comments