mirror of https://github.com/status-im/metro.git
Fix profiler setup
Summary: @public Update packager entry and profiler pre-built dylib + Update makefile to make it easier to use different versions of Xcode and shortcircuit when using the wrong version. Reviewed By: @jspahrsummers Differential Revision: D2498157
This commit is contained in:
parent
e5f2e03af2
commit
fb57c3a601
20
packager.js
20
packager.js
|
@ -233,14 +233,14 @@ function systraceProfileMiddleware(req, res, next) {
|
||||||
childProcess.exec(cmd, function(error) {
|
childProcess.exec(cmd, function(error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
if (error.code === 127) {
|
if (error.code === 127) {
|
||||||
res.end(
|
var response = '\n** Failed executing `' + cmd + '` **\n\n' +
|
||||||
'\n** Failed executing `' + cmd + '` **\n\n' +
|
|
||||||
'Google trace-viewer is required to visualize the data, You can install it with `brew install trace2html`\n\n' +
|
'Google trace-viewer is required to visualize the data, You can install it with `brew install trace2html`\n\n' +
|
||||||
'NOTE: Your profile data was kept at:\n' + dumpName
|
'NOTE: Your profile data was kept at:\n' + dumpName
|
||||||
);
|
console.log(response);
|
||||||
|
res.end(response);
|
||||||
} else {
|
} else {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
res.end('Unknown error %s', error.message);
|
res.end('Unknown error: ' + error.message);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -267,16 +267,16 @@ function cpuProfileMiddleware(req, res, next) {
|
||||||
var dumpName = '/tmp/cpu-profile_' + Date.now();
|
var dumpName = '/tmp/cpu-profile_' + Date.now();
|
||||||
fs.writeFileSync(dumpName + '.json', req.rawBody);
|
fs.writeFileSync(dumpName + '.json', req.rawBody);
|
||||||
|
|
||||||
var cmd = path.join(__dirname, '..', 'JSCLegacyProfiler', 'json2trace') + ' -cpuprofiler ' + dumpName + '.cpuprofile ' + dumpName + '.json';
|
var cmd = path.join(__dirname, '..', 'react-native-github', 'JSCLegacyProfiler', 'json2trace') + ' -cpuprofiler ' + dumpName + '.cpuprofile ' + dumpName + '.json';
|
||||||
childProcess.exec(cmd, function(error) {
|
childProcess.exec(cmd, function(error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
res.end('Unknown error: %s', error.message);
|
res.end('Unknown error: ' + error.message);
|
||||||
} else {
|
} else {
|
||||||
res.end(
|
var response = 'Your profile was generated at\n\n' + dumpName + '.cpuprofile\n\n' +
|
||||||
'Your profile was generated at\n\n' + dumpName + '.cpuprofile\n\n' +
|
'Open `Chrome Dev Tools > Profiles > Load` and select the profile to visualize it.';
|
||||||
'Open `Chrome Dev Tools > Profiles > Load` and select the profile to visualize it.'
|
console.log(response);
|
||||||
);
|
res.end(response);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue