fprintf(stderr, " pid selects process(s) to sample\n");
fprintf(stderr, " cmd selects process(s) matching command string to sample\n");
fprintf(stderr, "By default (no options) the following processes are excluded from the output:\n");
- fprintf(stderr, "dyld_usage, Terminal, telnetd, sshd, rlogind, tcsh, csh, sh\n\n");
+ fprintf(stderr, "dyld_usage, Terminal, telnetd, sshd, rlogind, tcsh, csh, sh\n");
exit(1);
}
if (auto dlopenNode = dynamic_cast<dlopen *>(node.get())) {
sstr << std::hex;
sstr << "{\"type\":\"dlopen\",\"path\":\"" << dlopenNode->path << "\",\"flags\":\"0x" << dlopenNode->flags << "\"";
- sstr << ",\"result\":\"" << dlopenNode->result << "\"";
+ sstr << ",\"result\":\"0x" << dlopenNode->result << "\"";
} else if (auto dlopenPreflightNode = dynamic_cast<dlopen_preflight *>(node.get())) {
sstr << std::hex;
sstr << "{\"type\":\"dlopen_preflight\",\"path\":\"" << dlopenPreflightNode->path << "\"";
- sstr << ",\"result\":\"" << dlopenPreflightNode->result << "\"";
+ sstr << ",\"result\":\"0x" << dlopenPreflightNode->result << "\"";
} else if (auto dlsymNode = dynamic_cast<dlsym *>(node.get())) {
sstr << std::hex << "{\"type\":\"dlsym\",\"symbol\":\"" << dlsymNode->symbol << "\",\"handle\":\"0x";
sstr << dlsymNode->handle << "\",\"result\":\"0x" << dlsymNode->result << "\"";
s = ktrace_session_create();
assert(s);
- while ((ch = getopt(argc, argv, "jJeR:t:")) != -1) {
+ while ((ch = getopt(argc, argv, "hjJeR:t:")) != -1) {
switch (ch) {
case 'j':
JSON_flag = true;
exit(1);
}
break;
+ case 'h':
default:
exit_usage();
}
if (!RAW_flag) {
if (geteuid() != 0) {
- fprintf(stderr, "'dyld_usage' must be run as root...\n");
+ fprintf(stderr, "'dyld_usage' must be run as root\n");
exit(1);
}
exit(1);
}
+ setvbuf(stdout, (char *)NULL, _IONBF, 0);
dispatch_main();
return 0;