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

Added static inlining support #8

Merged
merged 4 commits into from
Aug 7, 2024
Merged

Added static inlining support #8

merged 4 commits into from
Aug 7, 2024

Conversation

singul4ri7y
Copy link
Collaborator

@singul4ri7y singul4ri7y commented Aug 4, 2024

Added support to make the API functions static in ptracer.h header, so that the functions can be inlined if used in a single C/C++ translation with second order optimization and static linking. Improves performance although may introduce code redundancy across modules.

Resolves #9

@hugomg
Copy link
Member

hugomg commented Aug 4, 2024

I thought extern was only for global variables, not functions?

If the performance of dynamically linked frameenter is so bad, there's not much point in even allowing it as an option. We should move frameenter/setline/frameleave out of the "implementation" and into the ".h" part of the header file. Perhaps even define them as a macro, to guarantee that they are inlined.

@singul4ri7y
Copy link
Collaborator Author

The performance is bad, but not too bad that we should remove it. Besides, some modules may want to use dynamic version of Pallene Tracer. On top of that, the optimization mentioned is only applicable if you are using a single C file in entire module (just like Pallene does), which is sort of impractical if you are writing something heavyweight.

@hugomg
Copy link
Member

hugomg commented Aug 4, 2024

I would expect that inlining the frameenter/setline/frameexit is probably a good idea even if we have many C files, since those are all one-liners.

Copy link
Member

@hugomg hugomg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(see comment)

@singul4ri7y singul4ri7y merged commit 806350b into main Aug 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce the number of directories?
2 participants