Add support for stacktraces on Windows to the built-in profiler

RESOLVED FIXED in mozilla12

Status

()

Core
General
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

Trunk
mozilla12
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

I have a patch which enables us to walk the stack on Windows.  The symbolication part is missing, so it's not quite useful yet, but stepping through the code, things seem to be working fine.
Created attachment 588491 [details] [diff] [review]
Patch (v1)
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #588491 - Flags: review?(jmuizelaar)
Comment on attachment 588491 [details] [diff] [review]
Patch (v1)

Review of attachment 588491 [details] [diff] [review]:
-----------------------------------------------------------------

::: tools/profiler/sps/TableTicker.cpp
@@ +361,5 @@
>  }
>  #endif
>  
> +#ifdef USE_NS_STACKWALK
> +typedef nsTArray<void*> PCArray;

I don't think you can safely use an nsTArray when a thread is paused.
nsTArray will do mallocs which will deadlock if the stopped thread is inside malloc.

::: tools/profiler/sps/platform.h
@@ +204,5 @@
>    PlatformData* platform_data() { return data_; }
>  
> +#ifdef XP_WIN
> +  // xxxehsan sucky hack :(
> +  static uintptr_t GetThreadHandle(PlatformData*);

gross
Attachment #588491 - Flags: review?(jmuizelaar) → review-
Created attachment 588984 [details] [diff] [review]
Patch (v2)

Good catch.  I wonder why I didn't get hangs while testing. :/
Attachment #588491 - Attachment is obsolete: true
Attachment #588984 - Flags: review?(jmuizelaar)
Attachment #588984 - Flags: review?(jmuizelaar) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/2273e0264d4a
Target Milestone: --- → mozilla12
Backed you out in https://hg.mozilla.org/integration/mozilla-inbound/rev/e40e72d6264d since I was pretty sure you'd rather have Windows continue to build ;)
Ouch...  Some day I will learn how to program.  Until that day comes, here's a link to the log for reference: https://tbpl.mozilla.org/php/getParsedLog.php?id=8595118&tree=Mozilla-Inbound
Created attachment 589214 [details] [diff] [review]
Patch (v2) which actually compiles
Attachment #588984 - Attachment is obsolete: true
https://hg.mozilla.org/integration/mozilla-inbound/rev/419f8a0f6374
https://hg.mozilla.org/mozilla-central/rev/419f8a0f6374
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.