-
Notifications
You must be signed in to change notification settings - Fork 127
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
Trace2 stopwatch timers and global counters #1099
Changes from 2 commits
96f6896
ff8df1b
11c8d8c
531a1ee
82c445b
62a5c8b
36e57a2
0ef2319
4d6155e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,7 @@ static void event_fmt_prepare(const char *event_name, const char *file, | |
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Jeff Hostetler wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Jeff Hostetler wrote (reply to this):
|
||
jw_object_string(jw, "event", event_name); | ||
jw_object_string(jw, "sid", tr2_sid_get()); | ||
jw_object_string(jw, "thread", ctx->thread_name.buf); | ||
jw_object_string(jw, "thread", ctx->thread_name); | ||
|
||
/* | ||
* In brief mode, only emit <time> on these 2 event types. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ static int tr2env_perf_be_brief; | |
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Jeff Hostetler wrote (reply to this):
|
||
#define TR2FMT_PERF_FL_WIDTH (28) | ||
#define TR2FMT_PERF_MAX_EVENT_NAME (12) | ||
#define TR2FMT_PERF_MAX_THREAD_NAME (24) | ||
#define TR2FMT_PERF_REPO_WIDTH (3) | ||
#define TR2FMT_PERF_CATEGORY_WIDTH (12) | ||
|
||
|
@@ -105,9 +106,9 @@ static void perf_fmt_prepare(const char *event_name, | |
} | ||
|
||
strbuf_addf(buf, "d%d | ", tr2_sid_depth()); | ||
strbuf_addf(buf, "%-*s | %-*s | ", TR2_MAX_THREAD_NAME, | ||
ctx->thread_name.buf, TR2FMT_PERF_MAX_EVENT_NAME, | ||
event_name); | ||
strbuf_addf(buf, "%-*.*s | %-*s | ", TR2FMT_PERF_MAX_THREAD_NAME, | ||
TR2FMT_PERF_MAX_THREAD_NAME, ctx->thread_name, | ||
TR2FMT_PERF_MAX_EVENT_NAME, event_name); | ||
|
||
len = buf->len + TR2FMT_PERF_REPO_WIDTH; | ||
if (repo) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,17 +3,12 @@ | |
|
||
#include "strbuf.h" | ||
|
||
/* | ||
* Arbitry limit for thread names for column alignment. | ||
*/ | ||
#define TR2_MAX_THREAD_NAME (24) | ||
|
||
struct tr2tls_thread_ctx { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):
|
||
struct strbuf thread_name; | ||
uint64_t *array_us_start; | ||
int alloc; | ||
int nr_open_regions; /* plays role of "nr" in ALLOC_GROW */ | ||
size_t alloc; | ||
size_t nr_open_regions; /* plays role of "nr" in ALLOC_GROW */ | ||
int thread_id; | ||
char thread_name[FLEX_ARRAY]; | ||
}; | ||
|
||
/* | ||
|
@@ -25,9 +20,6 @@ struct tr2tls_thread_ctx { | |
* non-zero thread-ids to help distinguish messages from concurrent | ||
* threads. | ||
* | ||
* Truncate the thread name if necessary to help with column alignment | ||
* in printf-style messages. | ||
* | ||
* In this and all following functions the term "self" refers to the | ||
* current thread. | ||
*/ | ||
|
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.
On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):
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.
On the Git mailing list, Jeff Hostetler wrote (reply to this):
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.
On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):
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.
On the Git mailing list, Junio C Hamano wrote (reply to this):
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.
On the Git mailing list, Jeff Hostetler wrote (reply to this):