Use lttng_ust_tracef instead of lttng_ust__tracef#103
Merged
christophebedard merged 1 commit intorollingfrom Mar 28, 2024
Merged
Use lttng_ust_tracef instead of lttng_ust__tracef#103christophebedard merged 1 commit intorollingfrom
christophebedard merged 1 commit intorollingfrom
Conversation
Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
clalancette
approved these changes
Mar 27, 2024
Contributor
clalancette
left a comment
There was a problem hiding this comment.
Looks reasonable to me with green CI, including on RHEL.
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #95
Follow-up to #98
The "official" symbol that the LTTng documentation mentions is:
lttng_ust_tracef(), notlttng_ust__tracef()tracef(), not_lttng_ust_tracef()I thought that the difference between them is that the former checks if the tracepoint is enabled before triggering the tracepoint, while the latter just triggers it, but that is not the case. We can observe this by not enabling
lttng_ust_tracef:eventintracetools_test/case.py: the tracepoint does not get triggered. The latter still ends up checking if the tracepoint is enabled before triggering it. The difference is that the latter formats the string usingvasprintf()and then tries to trigger the tracepoint, which may or may not trigger depending on whether it is enabled or not: https://github.com/lttng/lttng-ust/blob/9261aeadea4674c3d68e05c2e8fcbcefa54feb56/src/lib/lttng-ust/tracef.c#L46. Therefore, the former avoids formatting the string if the tracepoint is not enabled.Anyway, all of this is to say that we should just use
lttng_ust_tracef()/tracef()even though it's just a test.This should be tested on RHEL because it uses LTTng <=2.12.