Skip to content

Commit

Permalink
Remove url from functionName in profiler data
Browse files Browse the repository at this point in the history
Summary:
[Profiler.ProfileNode](https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#type-ProfileNode) includes a [Runtime.CallFrame](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-CallFrame) field.

Runtime.CallFrame has 2 fields: `functionName` and `url`

ProfilerProfileSerializer was including the url information in the
functionName as well, which causes the profiler output to be difficult
to read because all function names become very long.

Reviewed By: jpporto

Differential Revision: D50902207

fbshipit-source-id: e608bf37c3a424f8b4bc49d663fc4be85c96632d
  • Loading branch information
dannysu authored and facebook-github-bot committed Nov 3, 2023
1 parent a068a80 commit f956163
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/VM/Profiler/ChromeTraceSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,7 @@ void ProfilerProfileSerializer::processNode(
RuntimeModule *module = frame.jsFrame.module;
hbc::BCProvider *bcProvider = module->getBytecode();

llvh::raw_string_ostream os(name);
os << getJSFunctionName(bcProvider, frame.jsFrame.functionId);
name = getJSFunctionName(bcProvider, frame.jsFrame.functionId);

url = "unknown";
OptValue<hbc::DebugSourceLocation> sourceLocOpt = getSourceLocation(
Expand All @@ -428,8 +427,6 @@ void ProfilerProfileSerializer::processNode(

lineNumber = sourceLocOpt.getValue().line;
columnNumber = sourceLocOpt.getValue().column;
// format: frame_name(file:line:column)
os << "(" << url << ":" << lineNumber << ":" << columnNumber << ")";
}
break;
}
Expand Down

0 comments on commit f956163

Please sign in to comment.