Uh oh!
There was an error while loading. Please reload this page.
tools: fix prof polyfill readline - #18641
Conversation
killagu
commented
Feb 8, 2018
node v9.4.0 and v9.5.0 may not print the full profile log file when use the |
There was a problem hiding this comment.
typo s/BORKEN_PART/BROKEN_PART/
Also, could we just use const BROKEN_PART = 'tick,'/ instead? "0x100840650" looks like a magic number here.
7b4e27c to
bfaee12Comparekillagu
commented
Feb 9, 2018
@mmarchini the magic number have been removed. |
Fishrock123
commented
Feb 10, 2018
There was a problem hiding this comment.
I'm not sure whether the linter (make lint) will complain or not, but this is difficult to read. Please use braces here.
479f168 to
fd9baf5Compare9b54b62 to
41f92a4Compare`node --prof foo.js` may not print the full profile log file, the last line will broken like `tick,` and not more blank line. `readline`will stuck in infinite loop, add `bytes === 0` will fix it.
41f92a4 to
33f4a51CompareXadillaX
commented
Feb 11, 2018
XadillaX
commented
Feb 11, 2018
| exports.restoreStdout = restoreWritable.bind(null, 'stdout'); | ||
| exports.restoreStderr = restoreWritable.bind(null, 'stderr'); | ||
| exports.isSymbolAvailable = exports.isWindows || | ||
| exports.isSunOS || |
There was a problem hiding this comment.
nit: align with exports above.
| Platform check for Windows 32-bit on Windows 64-bit. | ||
| ### isSymbolAvailable |
There was a problem hiding this comment.
Can we use a more descriptive name than this please?
There was a problem hiding this comment.
my bad,it should be isCPPSymbolsNotMapped. @cjihrig
| ### isSymbolAvailable | ||
| * [<Boolean>] | ||
| Platform check for if symbol available. |
There was a problem hiding this comment.
Similarly, can you provide a more in depth description.
killagu
commented
Feb 12, 2018
@cjihrig the property name,and readme have been changed to more descriptive. |
| * [<Boolean>] | ||
| Platform check for if symbol available. | ||
| Platform check for c++ symbols are mapped or not. |
| tmpdir.refresh(); | ||
| if (!common.enoughTestCpu) | ||
| common.skip('test is CPU-intensive'); |
There was a problem hiding this comment.
Nit: would you be so kind and use a capital letter as first character? :-)
There was a problem hiding this comment.
In the node test,the first character in skip message is always lower case.
| common.skip('test is CPU-intensive'); | ||
| if (common.isCPPSymbolsNotMapped) { | ||
| common.skip('C++ symbols are not mapped for this os.'); |
There was a problem hiding this comment.
Nit: Operating system should be upper cased as in OS.
There was a problem hiding this comment.
Thank you for the advice.It should be upper cased.
| //This test will produce a broken profile log. | ||
| //ensure prof-polyfill not stuck in infinite loop | ||
| //and success process |
There was a problem hiding this comment.
Nit: please use a space at the beginning of each line in a comment.
There was a problem hiding this comment.
Thank you for the advice.It should have a space at the beginning of each line.
| this.ts = Date.now(); | ||
| setImmediate(function() { new f(); }); | ||
| }; | ||
| f();`; |
There was a problem hiding this comment.
Nit: we have the unwritten rule not to use multi line template strings.
There was a problem hiding this comment.
Thank you for the advice.I will split it to two lines.
| '--prof-process', LOG_FILE | ||
| ]); | ||
| assert(WARN_REG_EXP.test(child.stderr.toString())); | ||
| assert.strictEqual(child.status, 0, 'broken file should success too'); |
There was a problem hiding this comment.
I personally would like to stick to the default message.
There was a problem hiding this comment.
The default message will be removed.
| return ''; | ||
| } | ||
| if (bytes === 0) { | ||
| process.emitWarning('profile file is broken', { |
There was a problem hiding this comment.
Suggestion: you might just add the filename of the broken file? And please use a capital letter as first character.
There was a problem hiding this comment.
Thank you for the advice.Add the filename is better.
fix warn message fix comment style
killagu
commented
Feb 17, 2018
@BridgeAR Thank you for the advice.I have update the code.Please review it. |
BridgeAR
commented
Feb 17, 2018
`node --prof foo.js` may not print the full profile log file, leaving the last line broken (for example `tick,`. When that happens, `readline` will be stuck in an infinite loop. This patch fixes it. Also introduced `common.isCPPSymbolsNotMapped` to avoid duplicated code on tick-processor tests. PR-URL: #18641 Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
mmarchini
commented
Feb 17, 2018
Landed in 38f04d4 😄 |
MylesBorins
commented
Feb 21, 2018
Should this be backported to |
killagu
commented
Feb 21, 2018
@MylesBorins It should be backported to v9.x-staging,and I will raise a backport PR. |
`node --prof foo.js` may not print the full profile log file, leaving the last line broken (for example `tick,`. When that happens, `readline` will be stuck in an infinite loop. This patch fixes it. Also introduced `common.isCPPSymbolsNotMapped` to avoid duplicated code on tick-processor tests. PR-URL: nodejs#18641 Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
killagu
commented
Feb 21, 2018
@MylesBorins I have raised a PR to backport it. BTW I have no permission for run the CI. If you can help me trigger the CI, you are so kind. |
`node --prof foo.js` may not print the full profile log file, leaving the last line broken (for example `tick,`. When that happens, `readline` will be stuck in an infinite loop. This patch fixes it. Also introduced `common.isCPPSymbolsNotMapped` to avoid duplicated code on tick-processor tests. PR-URL: nodejs#18641 Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
`node --prof foo.js` may not print the full profile log file, leaving the last line broken (for example `tick,`. When that happens, `readline` will be stuck in an infinite loop. This patch fixes it. Also introduced `common.isCPPSymbolsNotMapped` to avoid duplicated code on tick-processor tests. Backport-PR-URL: #18901 PR-URL: #18641 Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
`node --prof foo.js` may not print the full profile log file, leaving the last line broken (for example `tick,`. When that happens, `readline` will be stuck in an infinite loop. This patch fixes it. Also introduced `common.isCPPSymbolsNotMapped` to avoid duplicated code on tick-processor tests. Backport-PR-URL: #18901 PR-URL: #18641 Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
`node --prof foo.js` may not print the full profile log file, leaving the last line broken (for example `tick,`. When that happens, `readline` will be stuck in an infinite loop. This patch fixes it. Also introduced `common.isCPPSymbolsNotMapped` to avoid duplicated code on tick-processor tests. PR-URL: nodejs#18641 Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
`node --prof foo.js` may not print the full profile log file, leaving the last line broken (for example `tick,`. When that happens, `readline` will be stuck in an infinite loop. This patch fixes it. Also introduced `common.isCPPSymbolsNotMapped` to avoid duplicated code on tick-processor tests. Backport-PR-URL: #18901 PR-URL: #18641 Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
`node --prof foo.js` may not print the full profile log file, leaving the last line broken (for example `tick,`. When that happens, `readline` will be stuck in an infinite loop. This patch fixes it. Also introduced `common.isCPPSymbolsNotMapped` to avoid duplicated code on tick-processor tests. Backport-PR-URL: #18901 PR-URL: #18641 Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

node --prof foo.jsmay not print the full profile log file,the last line will broken like
tick,and not more blank line.readlinewill stuck in infinite loop, addbytes < buf.lengthwill fix it.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
@bnoordhuis