Well-formatted and improved trace system calls and signals (when the debugger does not help)

Overview

ctrace

Well-formatted and improved trace system calls and signals (when the debugger does not help).

Why?

Awesome tools strace and dtruss have only one drawback: too much information which is hard to understand without additional sources of information and various configuration options. ctrace resolves it.

ctrace are indispensable in the following cases

  • Debugging complex performance issues or not identified unhandled errors and exceptions in own code or someone else's code
  • Learning OS kernel

Let's try it!

What do you think how difficult it is to display a hint for using CLI utility, let us say NPM?

> ctrace -c "npm --help"

What we see?! What NPM does to simply display help?

  • over 6800 system calls elapsed over 650 msec!
  • 7 child processes 😮
  • aims to open over 400 files

Сlearly there is something to improve! 💪

Features

  • Supported platforms: OSx (dtruss), Linux (strace)
  • Trace command or attach to process (with forks following)
  • Syscall details in output (number, description, synonyms, is it platform specific syscall)
    pread (preadv), 534 -- read or write data into multiple
  • Resolving errno in syscall result
    Err#22 -> EINVAL : Invalid argument (only OSx)
  • Prints by default only syscall with errors, with -v prints all output
  • Filter output with syscall list -f "lstat,open"

Installation

$> npm install -g ctrace
$> ctrace --help

Usage: ctrace [options]

 ctrace - well-formatted and improved trace system calls and signals

 Options:

   -h, --help               output usage information
   -V, --version            output the version number
   -p, --pid [pid]          process id to trace
   -c, --cmd [cmd]          command to trace
   -f, --filter [syscall,]  trace syscall only from list
   -v, --verbose            print all syscalls (by default only with errors)

 Examples:

   $ ctrace -p 2312 -v
   $ ctrace -c "ping google.com"

Troubleshooting

OSx : Dtrace cannot control executables signed with restricted entitlements

As you may know Apple released their new OS X revision 10.11 this year with a great security feature built-in: System Integrity Protection. In a nutshell, this mechanism protects any system data and important filesystem components (like /System or /usr) from being modified by user; even if they are root. SIP also disables any use of code-injection and debugging techniques for third-party software, so some of your favorite hacks may not work anymore. ...

Completely disable SIP

Although not recommended by Apple, you can entirely disable System Integrity Protection on you Mac. Here's how:

Boot your Mac into Recovery Mode: reboot it and hold cmd+R until a progress bar appears. Choose the language and go to Utilities menu. Choose Terminal there. Enter this command to disable System Integrity Protection:

$> csrutil disable

It will ask you to reboot — do so and you're free from SIP!

http://internals.exposed/blog/dtrace-vs-sip.html#fnref1

You might also like...

API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices.

API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices.

swagger-stats | API Observability https://swaggerstats.io | Guide Trace API calls and Monitor API performance, health and usage statistics in Node.js

Jan 4, 2023

App to manage maintenance calls. App to manage maintenance calls. This application was created for the purpose of studies.

App to manage maintenance calls. App to manage maintenance calls. This application was created for the purpose of studies.

App to manage maintenance calls. App to manage maintenance calls. This application was created for the purpose of studies.

Dec 26, 2022

Turn your ES5 code into readable ES6. Lebab does the opposite of what Babel does.

Turn your ES5 code into readable ES6. Lebab does the opposite of what Babel does.

Lebab Lebab transpiles your ES5 code to ES6/ES7. It does exactly the opposite of what Babel does. If you want to understand what Lebab exactly does, t

Dec 31, 2022

⚡️The Fullstack React Framework — built on Next.js

⚡️The Fullstack React Framework — built on Next.js

The Fullstack React Framework "Zero-API" Data Layer — Built on Next.js — Inspired by Ruby on Rails Read the Documentation “Zero-API” data layer lets y

Jan 4, 2023

Uncensorable, immutable microblogging platform that is completely decentralized and does not rely on any centralized systems.

Uncensorable, immutable microblogging platform that is completely decentralized and does not rely on any centralized systems.

Zooko Truly decentralized, immutable and uncensorable microblogging Zooko is a working-example, proof-of-concept proving that you can have a decentral

Apr 20, 2022

About Discord bot draft that does not contain ready-made commands, compatible with discord.js v14. Create your own discord bot with this command handler.

discordJS-V14 About Discord bot draft that does not contain ready-made commands, compatible with discord.js v14. Create your own discord bot with this

Dec 28, 2022

Plain JavaScript version of jQuery's slideToggle(), slideDown(), & slideUp(), but does not use display: none.

dom-slider It works like jQuery's slideToggle(), slideDown(), & slideUp(), but does not use display: none. Uses CSS3 transitions and element.scrollHei

Dec 27, 2022

Feel free to create new file, don't hesitate to pull your code, the most important thing is that the file name here must match your nickname so that file does not conflict with other people.

Hacktoberfest Indonesia Apa Itu Hacktoberfest ? Hacktoberfest adalah acara tahunan yang bertujuan untuk mendorong berkontribusi kedalam ekosistem open

Dec 15, 2022

Trusted timestamps that you can physically include in photos, videos and live streams using QR codes and audible data signals.

Trusted timestamps that you can physically include in photos, videos and live streams using QR codes and audible data signals.

QR Date This is the reference implementation for the first version of QR Date, a signed timestamp inside a QR code that you can use to verify the date

Oct 5, 2022

A bot that automatically claims winnings and runs 100% unattended. Now you can play while working, with friends, etc; Uses signals from TradingView to predict the price of BNB for up or down wagers in the PancakeSwap prediction game

A bot that automatically claims winnings and runs 100% unattended. Now you can play while working, with friends, etc; Uses signals from TradingView to predict the price of BNB for up or down wagers in the PancakeSwap prediction game

*** Auto-Claim Prediction Robot *** $$$$$ Automatically claim your winnings!!! $$$$$ No more babysitting and checking balance!!! Play while you're at

Nov 4, 2022

Ticket system v2, many new and improved features. Optimized code.

Ticket system v2, many new and improved features. Optimized code.

Global Ticket System V2 Ticket system v2, many new and improved features. Optimized code. Dependencies: mongoose = npm i mongoose dotenv = npm i dot

Dec 2, 2022

The Frontend of Escobar's Inventory Management System, Employee Management System, Ordering System, and Income & Expense System

The Frontend of Escobar's Inventory Management System, Employee Management System, Ordering System, and Income & Expense System

Usage Create an App # with npx $ npx create-nextron-app my-app --example with-javascript # with yarn $ yarn create nextron-app my-app --example with-

Jan 2, 2023

Parcel Next JS - A simple website with Authentication and basic API calls to a backend system.

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Jan 2, 2022

e-ONG, an authorial project, whose objective is to help ONGs to find people who need help or would like to help them

This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: npm start Runs the app in the developmen

Nov 11, 2022

Only 90's kids remember... well not really, but these beloved effects that would follow your mouse around will always be classic reminders of the old, beloved internet.

90's Cursor Effects "Knowing the codes" used to be all the rage, I want to bring a few back. A repo of the old effects that inspired creativity and th

Jan 9, 2023

Node.js debugger based on Blink Developer Tools

Node Inspector Overview Node Inspector is a debugger interface for Node.js applications that uses the Blink Developer Tools (formerly WebKit Web Inspe

Dec 29, 2022

A pretty darn cool JavaScript debugger for Brackets

A pretty darn cool JavaScript debugger for Brackets

Theseus Theseus is a new type of JavaScript debugger for Node.js, Chrome, and both simultaneously. It is an extension for the Brackets code editor. Th

Dec 20, 2022

Visual debugger for framer-motion

Visual debugger for framer-motion

Visual debugger for framer-motion Demo install npm install tracer-motion --save-dev # or yarn add tracer-motion --dev usage import { motion } from

Oct 9, 2022

Time-traveling debugger for Svelte applications

Time-traveling debugger for Svelte applications

DeLorean The first time-travelling debugger for Svelte applciations DeLorean is a debugging tool for Svelte developers. It records snapshots when a ta

Oct 8, 2022
Owner
Aleksandr Komlev
Aleksandr Komlev
Node.js debugger based on Blink Developer Tools

Node Inspector Overview Node Inspector is a debugger interface for Node.js applications that uses the Blink Developer Tools (formerly WebKit Web Inspe

null 12.6k Dec 29, 2022
A pretty darn cool JavaScript debugger for Brackets

Theseus Theseus is a new type of JavaScript debugger for Node.js, Chrome, and both simultaneously. It is an extension for the Brackets code editor. Th

Adobe Research 1.3k Dec 20, 2022
ndb is an improved debugging experience for Node.js, enabled by Chrome DevTools

ndb ndb is an improved debugging experience for Node.js, enabled by Chrome DevTools Installation Compatibility: ndb requires Node >=8.0.0. It works be

null 10.8k Dec 28, 2022
Node is running but you don't know why? why-is-node-running is here to help you.

why-is-node-running Node is running but you don't know why? why-is-node-running is here to help you. Installation Node 8 and above: npm i why-is-node-

Mathias Buus 1.5k Dec 30, 2022
📡 Encrypt and authenticate DevTools to use it securely remotely. Add HTTPS, and authentication to --remote-debugging-port to debug, inspect and automate from anywhere and collaborate securely on bugs.

?? Encrypt and authenticate DevTools to use it securely remotely. Add HTTPS, and authentication to --remote-debugging-port to debug, inspect and automate from anywhere and collaborate securely on bugs.

Cris 9 May 5, 2022
An lldb plugin for Node.js and V8, which enables inspection of JavaScript states for insights into Node.js processes and their core dumps.

Node.js v10.x+ C++ plugin for the LLDB debugger. The llnode plugin adds the ability to inspect JavaScript stack frames, objects, source code and more

Node.js 1k Dec 14, 2022
A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers

debug A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers. Installation $ npm ins

Sloth 10.5k Dec 30, 2022
A Node.js tracing and instrumentation utility

njsTrace - Instrumentation and Tracing njstrace lets you easily instrument and trace you code, see all function calls, arguments, return values, as we

Yuval 354 Dec 29, 2022
thetool is a CLI tool to capture different cpu, memory and other profiles for your node app in Chrome DevTools friendly format

thetool thetool is a CLI tool to capture different cpu, memory and other profiles for your node app in Chrome DevTools friendly format. Quick start np

null 200 Oct 28, 2022
A project to showcase a poc of distributed systems with message queue, graphql, grpc, http server with added monitoring and tracing capabilities.

trace-sandbox Trace sandbox is a project to showcase a poc of distributed systems with message queue, graphql, grpc, http server with added monitoring

Alfian Pramudita 6 Jun 24, 2021