New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 690197 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature



Sign in to add a comment

Add method for recording the last N PostTasks to create a "virtual" backtrace of async actions.

Project Member Reported by ajwong@chromium.org, Feb 8 2017

Issue description

Chromium code uses PostTask a lot to do a poorman's version of continuation passing style.

Thus, a "backtrace" is often incomplete because it terminates at the most recently executed task. The FROM_HERE/posted_from token helps give 1 frame of context, but what's often wanted is a short record of all the various asynchronous posts.

This can fairly easily be implemented by adding a short array of program_counters providing a breadcrumb (or async backtrace) of posted_from records. This array can then be copied onto the stack during a task execution and aliased to ensure the compiler does not optimize it out.

Because it is on the stack, it will be captured in crash dumps.

There will need to be tooling in the crash processing system to recognize and symbolize this object, but at least the data will be there.

The performance impact of this will be the equivalent of a 4 word copy per post-task. Almost certainly eaten by the pipeline.
 
note: when current_pending_task is hosited out of MessageLooop, remember to undo the friend for the PendingTaskTest from MessageLoop and to stuff PendingTaskTest into an anonymous namespace.
Investigate if there's a good way to handle alignment + sizing of the backtrace to ensure vectorized std::copy...
Project Member

Comment 4 by bugdroid1@chromium.org, Feb 9 2017

Sign in to add a comment