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

inline tool gives misleading output on console #19

Open
marcosps opened this issue May 7, 2024 · 5 comments
Open

inline tool gives misleading output on console #19

marcosps opened this issue May 7, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@marcosps
Copy link
Collaborator

marcosps commented May 7, 2024

When using the inline tool from clang-extract to check for inlined functions, if the output it set to be done to -graphviz it works as expected:

a

But if the output is the console, then it shows a different picture:

~/git/clang-extract/build/inline -where-is-inlined -ipa-files drivers/net/ipvlan/ipvlan_core.c.000i.ipa-clones  -debuginfo ~/kgr/data/x86_64/lib/modules/5.14.21-150500.55.31-default/kernel/drivers/net/ipvlan/ipvlan.ko  -symvers Module.symvers ipvlan_process_outbound                     
Mangled name        Demangled name      Type    Available?
ipvlan_queue_xmit   ipvlan_queue_xmit   FUNC    Public symbol
ipvlan_xmit_mode_l3 ipvlan_xmit_mode_l3 NOTYPE  Inlined

IMHO, I would expect the last entry to be the public symbol. Maybe we could change the output to let it more obvious which function should be extracted.

@marcosps marcosps added the enhancement New feature or request label May 7, 2024
@giulianobelinassi
Copy link
Collaborator

ipvlan_xmit_mode_l3 is not labeled as Public Symbol most likely the symbol was not present on the debuginfo (.o ELF?) you passed on -debuginfo flag. Hence there is no way for the tool to know that it is a public symbol that got inlined.

@marcosps
Copy link
Collaborator Author

marcosps commented May 9, 2024

I agree, and the top most symbol that is public is indeed ipvlan_queue_xmit. But in this case there could be a more visible output to show this is the symbol that we need to livepatch. It's not a big deal, but improving the output would help us to use more the console output.

Graphviz already generates a very nice output of what we want to know. maybe the console output could be more straightforward as well.

@giulianobelinassi
Copy link
Collaborator

What is the output you expect?

@marcosps
Copy link
Collaborator Author

marcosps commented May 9, 2024

At least that the entries are sorted in the same way of the graphviz output: the private symbol comes first, and the last entry should be the function to be patched.

@giulianobelinassi
Copy link
Collaborator

At least that the entries are sorted in the same way of the graphviz output: the private symbol comes first, and the last entry should be the function to be patched.

You will have to sort the output the way you want in InlineAnalysis.cpp:457.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants