Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracepoints functions can not be searched #392

Open
Tropicao opened this issue Feb 19, 2025 · 1 comment
Open

Tracepoints functions can not be searched #392

Tropicao opened this issue Feb 19, 2025 · 1 comment
Labels
indexing Related to the index content — missing definitions/references, lexer bugs, new ctags features...

Comments

@Tropicao
Copy link

Knowing the name of a specific tracepoint in the kernel (eg: sched_switch), it is currently possible to find its definition, but the corresponding function call can not be found directly with the search field. In this example, the corresponding function is trace_sched_switch, but inputing trace_sched_switch in the research field yields no results in Elixir.

@Tropicao Tropicao added the bug label Feb 19, 2025
@tleb
Copy link
Member

tleb commented Feb 19, 2025

So we have two entry types (summarising):

  • defs, or definitions. Those are given to us by universal-ctags.
  • refs, or references. Those are ANY word in the source code that have a definition with the same name.

So we don't have any entry for trace_sched_switch because ctags gives us no entry for it anywhere in the kernel. And no references because there are no definitions.


We could be able to do something about the definition using ctags -D:

⟩ wget -O sched.h \
    'https://elixir.bootlin.com/linux/v6.13.3/source/include/trace/events/sched.h?raw'

⟩ ctags -x -D "TRACE_EVENT(NAME, ...)=void trace_##NAME(void) {}" sched.h | \
    grep sched_switch
__trace_sched_switch_state function    190 sched.h          static inline long __trace_sched_switch_state(bool preempt,
trace_sched_switch function    269 sched.h          );

The issue is that -D leads to functions reported at the end of the macro. The question was asked to the universal-ctags maintainer. See #379. And masatake released a draft PR two days ago handling the issue! universal-ctags/ctags#4198

@fstachura fstachura added the indexing Related to the index content — missing definitions/references, lexer bugs, new ctags features... label Feb 21, 2025
@tleb tleb removed the bug label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
indexing Related to the index content — missing definitions/references, lexer bugs, new ctags features...
Projects
None yet
Development

No branches or pull requests

3 participants