Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

windows: emit ETW events with v8 stack trace information #4219

Closed
wants to merge 5 commits into from
Closed

windows: emit ETW events with v8 stack trace information #4219

wants to merge 5 commits into from

Conversation

sblom
Copy link

@sblom sblom commented Oct 30, 2012

Latest version of @HenryRawas's V8 symbols via ETW code. Previous version reviewed by @piscisaureus and @bnoordhuis at https://github.com/MSOpenTech/node/commit/1a59ffbd31cf06f6c7e0f5c807366ec733c8e153. I'm on deck to address any feedback/issues with this change.

static uv_async_t dispatch_etw_events_change_async;

struct v8tags {
const char *prefix;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style police: 2 spaces, not 4, and const char* instead of const char *

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, another thing - since this data structure will be read often, do it like this:

struct v8tags {
  char prefix[32 - sizeof(size_t)];
  size_t prelen;
};

Avoids a level of indirection and makes it fit in a single cache line. Presumably prelen doesn't have to be a size_t because it's never going to be very large.

sblom added 3 commits October 31, 2012 10:38
Added two new ETW writer macros that accept an existing string length so
as to not make a redundant strlen or wcslen call.

I'm using the new version of the macro in the one place that I could find
where the string length is already known in context. Other reductions are
probably possible here, but would take more plumbing (and changes in
dtrace code as well).
INLINE void NODE_V8SYMBOL_MOVE(const void* addr1, const void* addr2);
INLINE void NODE_V8SYMBOL_RESET();
INLINE void NODE_V8SYMBOL_ADD(LPCSTR symbol,
int symbol_len,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent error.

Incorporate feedback from @piscisaureus and @bnoordhuis from
#4219
@sblom
Copy link
Author

sblom commented Nov 1, 2012

Okay--I believe my latest commit incorporates 100% of the review feedback.

I've built release and debug on 64-bit Windows. I've tested that we're actually getting the ETW events that we claim this patch introduces and did some debuggering to make sure our failure paths (NULL, Invalid) do what we expect even though we never expect them.

Do we have a pre-commit checklist that includes anything I'm neglecting here?

/cc @piscisaureus, @bnoordhuis

@piscisaureus
Copy link

Do we have a pre-commit checklist that includes anything I'm neglecting here?

Not really. But generally we ask ourselves:

  • Do we need / want this?
  • Did it get reviewed?
  • Does it work? (In this case I can't really verify that - that's why I wanted to see your tooling)
  • Did the author sign the CLA?

@piscisaureus
Copy link

LGTM, and landed in 66f64ae. Thanks @HenryRawas and @sblom.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants