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

Add init_root_info function to initialize trace information structs. #2

Merged
merged 1 commit into from Aug 9, 2016

Conversation

@vears91
Copy link

vears91 commented Jul 19, 2016

The init_root_info function can be used from rbd engine or elsewhere to initialize trace information, without having to assign unused endpoints or trace names.

Signed-off-by: Victor Araujo ve.ar91@gmail.com

OUT:
return res;
}

This comment has been minimized.

Copy link
@cbodley

cbodley Jul 20, 2016

let's call this blkin_init_trace_info() and have it return void (don't bother checking for !trace_info)

we don't want span_id and trace_id to be the same, assign them separate random_big()s

it should do the same thing that blkin_init_new_trace() is doing to its new_trace->info, so we can modify blkin_init_new_trace() to call blkin_init_trace_info(&new_trace->info) instead

This comment has been minimized.

Copy link
@vears91

vears91 Jul 21, 2016

Author

Ok. Any reason for not having the same span_id and trace_id in a root span?

From the documentation and the data model example

Span Id
The ID for a particular span. This may or may not be the same as the trace id.

Having the same ID for root spans can be faster. If you agree I can rename it to blkin_init_new_trace() and take a parameter to set the trace and span ids to the same or a different value, and if not I just use different ids.

This comment has been minimized.

Copy link
@cbodley

cbodley Jul 21, 2016

This may or may not be the same as the trace id.

interesting, thanks. i would definitely prefer we make less calls to rand, so i'm okay with having blkin_init_trace_info() and blkin_init_new_trace() always initialize span_id=trace_id

@vears91 vears91 force-pushed the vears91:root-info branch from 441669a to 5ed3f2f Jul 26, 2016
…properties

The blkin_init_root_info function can be used from rbd engine or elsewhere to initialize trace information, without having to assign unused endpoints or trace names.

blkin_set_trace_properties assigns the name, endpoint and trace information when initializing traces. It avoids the unused initialization of trace identifiers with random_big(), that were unused when the trace information from the argument in ZTracer::Trace::init(name, endpoint, trace_information, child) was set.

Signed-off-by: Victor Araujo <ve.ar91@gmail.com>
@vears91 vears91 force-pushed the vears91:root-info branch from 5ed3f2f to 2d5853e Jul 26, 2016
@cbodley cbodley merged commit ac55e48 into linuxbox2:master Aug 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.