Re: [PATCH v2 6/9] perf tools: add destructors for parse event terms

From
Ian Rogers <irogers@google.com>
Date
2019-10-24 19:03:41
Also in
bpf, lkml
Reply to
Jiri Olsa, 2019-10-23
Sorry, the intent here is that patch v2 be used in preference to the
1st patch, it looks like you've applied both. The first patch split
apart tracepoint_name to avoid accessing out of scope stack memory,
the second patch allocates heap memory that is correctly destructed
(and consequently needs 1 fewer struct tracepoint_name member). Please
disregard the 1st patch and just apply the second series.

Thanks,
Ian


On Wed, Oct 23, 2019 at 2:01 AM Jiri Olsa [off-list ref] wrote:
On Tue, Oct 22, 2019 at 05:53:34PM -0700, Ian Rogers wrote:
quoted
If parsing fails then destructors are ran to clean the up the stack.
Rename the head union member to make the term and evlist use cases more
distinct, this simplifies matching the correct destructor.
I'm getting compilation fail:

  CC       util/parse-events-bison.o
util/parse-events.y: In function ‘yydestruct’:
util/parse-events.y:125:45: error: ‘struct tracepoint_name’ has no member named ‘sys’; did you mean ‘sys1’?
  125 | %destructor { free ($$.sys); free ($$.event); } <tracepoint_name>

jirka
Thread (101 messages) 101 messages, 4 authors, last reply 2019-11-12
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help