This repository was archived by the owner on Jun 28, 2022. It is now read-only.
Enhance Tags API#49
Merged
Merged
Conversation
ivoanjo
reviewed
Apr 12, 2022
ivoanjo
left a comment
Member
There was a problem hiding this comment.
Left a bunch of tiny nitpicks, but overall it seems quite reasonable 😄
Co-authored-by: Ivo Anjo <[email protected]>
Ivo thinks this will give a better result for this edge, and it made the code simpler, so I went for it. Also run cargo fmt.
ivoanjo
reviewed
Apr 13, 2022
| #[repr(C)] | ||
| pub struct ParseTagsResult { | ||
| tags: crate::Vec<Tag>, | ||
| error_message: Option<Box<crate::Vec<u8>>>, |
Member
There was a problem hiding this comment.
Thanks for checking. Would it make sense to add it as a comment, so that it shows up on ffi.h?
Co-authored-by: Ivo Anjo <[email protected]>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What does this PR do?
This adds back the tags FFI API and supports
DD_TAGSparsing.Fixes the exporter example.
Motivation
I want DD_TAGS parsing in PHP and it wasn't as simple as I hoped, so
trying to share the work here too.
Additional Notes
The
test_duptest is the one that would previously sigsgev (sometimes).Now that lifetimes and other things have been cleaned up, I can't get
it to sigsev anymore.
How to test the change?
Most
ddprof_ffi_Vec_tagfunctions are the same as before. The newfunction
ddprof_ffi_Vec_tag_parsetakes aCharSliceand returns aParseTagsResult:In this sense, it doesn't "fail" but returns a
Vec<Tag>of successfullyparsed tags, and an error message summarizing everything that failed.
I've tested this locally with an updated branch of dd-prof-php.