This repository has been archived by the owner on Jun 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
This file contains 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
ivoanjo
reviewed
Apr 12, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a bunch of tiny nitpicks, but overall it seems quite reasonable 😄
Co-authored-by: Ivo Anjo <ivo.anjo@datadoghq.com>
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>>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking. Would it make sense to add it as a comment, so that it shows up on ffi.h
?
ivoanjo
approved these changes
Apr 13, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Co-authored-by: Ivo Anjo <ivo.anjo@datadoghq.com>
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_TAGS
parsing.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_dup
test 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_tag
functions are the same as before. The newfunction
ddprof_ffi_Vec_tag_parse
takes aCharSlice
and 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.