Skip to content

Lua Parsing of Tracepoint Fields doesn't handle __data_loc correctly #5419

@gorgonical

Description

@gorgonical

Some arguments of tracepoint fields are of the format __data_loc char[] var, which is not being parsed correctly by the Lua tooling.

This problem is very similar to the one mentioned here: bpftrace/bpftrace#385

To fix this, I have taken the same approach proposed by @brendangregg in that issue of transforming them to char* instead.

src/lua/bpf/cdef.lua:

275,276c275
<          local g = string.gsub(f, "__data_loc char%[%]", "char*")
<          table.insert(fields, g)
---
>               table.insert(fields, f)

My approach right now is rather a hack, so please advise on what should be done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions