node-tick icon indicating copy to clipboard operation
node-tick copied to clipboard

Errors while working on Mac

Open Olegas opened this issue 10 years ago • 5 comments

When running on Mac OS X, node-tick-processor seems to work, but before result is displayed it show a vast amout of errors like this:

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm: invalid argument -C
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm [-agnopruUmxjlfAP[s segname sectname] [-] [-t format] [[-arch <arch_flag>] ...] [file ...]

XCode: 6.2 Mac OS X: 10.10.2

Olegas avatar Mar 23 '15 05:03 Olegas

yes, actually reproduced this an hour ago myself. Seems that nm bundled with XCode accepts different set of arguments ( and for some reason UnixCppEntriesProvider is used instead of MacCppEntriesProvider ). You can manually change it to look like this:

748 UnixCppEntriesProvider.prototype.loadSymbols = function(libName) {¬
 749   this.parsePos = 0;¬
 750   libName = this.targetRootFS + libName;¬
 751   try {¬
 752     this.symbols = [¬
 753       //os.system(this.nmExec, ['-C', '-n', '-S', libName], -1, -1),¬
 754       //os.system(this.nmExec, ['-C', '-n', '-S', '-D', libName], -1, -1)¬
 755       os.system(this.nmExec, ['-n', libName], -1, -1),¬
 756       os.system(this.nmExec, ['-n', libName], -1, -1)¬
 757     ];¬
 758   } catch (e) {¬
 759     // If the library cannot be found on this system let's not panic.¬
 760     this.symbols = ['', ''];¬
 761   }
 762 };

I'll try to investigate what is correct way to call nm on osx and why UnixCppEntriesProvider is created

sidorares avatar Mar 23 '15 05:03 sidorares

I have the same issue. I repeat what I wrote in io.js issues:

I try to profile this script with Node 0.10.37 on the Max OS X 10.10: node --prof sorting.js. node-tick shows this result: http://pastebin.com/8Xmva4xz Looks like correct profile.

But on the 0.12.0 it shows this: http://pastebin.com/JVZrQDsY There is no 80% time in system libraries in profile: http://pastebin.com/ZSXekRpg, but 11% in node is questionable.

andre487 avatar Mar 23 '15 12:03 andre487

@Olegas start it as node-tick-processor --mac. I'll add automatic platform detection, but right now you need to make it explicitly

sidorares avatar Mar 24 '15 00:03 sidorares

Is it OK to collect log with one OS and then analyze with another? My log is from CentOS and analyzing on Mac.

Olegas avatar Mar 24 '15 04:03 Olegas

ok for js, but not for object files ( C++ profiling ) - nm does program counter to (mangled) c++ function name mapping and this is probably different for centos vs osx libraries

sidorares avatar Mar 24 '15 04:03 sidorares