From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 8B4997FE53 for ; Wed, 9 Mar 2016 19:13:47 +0100 (CET) IronPort-PHdr: 9a23:gBfkExGF9w6IuFPyxZJevp1GYnF86YWxBRYc798ds5kLTJ75r8ywAkXT6L1XgUPTWs2DsrQf27WQ4/6rADRQqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh7/0q8OYOl0YzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IeezAcq85Vb1VCig9eyBwvZWz9EqLcQzaxXIHSmgM2jhBBRPe4RfhFsPSuzDiu/A7+iCcJtb7S6scWTu58+FgTxq+2wkdMDts2W3Ni8F2xIRSrB+770h2z5TVbYe9Mv1ifeXaZ9xMFjkJZdpYSyEUWtD0VIAIFedUeL8A94Q= Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=adrien@notk.org; spf=Pass smtp.mailfrom=adrien@notk.org; spf=None smtp.helo=postmaster@nautica.notk.org Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of adrien@notk.org) identity=pra; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of adrien@notk.org designates 91.121.71.147 as permitted sender) identity=mailfrom; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@nautica.notk.org) identity=helo; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="postmaster@nautica.notk.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DaBQCRZuBW/5NHeVtdgzuCEAKCGqkkjlGBbTGFXgKBSjoSAQEBAQEBAQFjJ4ItghUBAQQjVhALGgIFEw4CAg8FGDGIO7AVjyUBAQgBAQEBHHyFHIRChzorgQ8FlzeNaApkjhiOXicIM4NlO4oBAQEB X-IPAS-Result: A0DaBQCRZuBW/5NHeVtdgzuCEAKCGqkkjlGBbTGFXgKBSjoSAQEBAQEBAQFjJ4ItghUBAQQjVhALGgIFEw4CAg8FGDGIO7AVjyUBAQgBAQEBHHyFHIRChzorgQ8FlzeNaApkjhiOXicIM4NlO4oBAQEB X-IronPort-AV: E=Sophos;i="5.24,312,1454972400"; d="scan'208";a="206871821" Received: from nautica.notk.org ([91.121.71.147]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-GCM-SHA384; 09 Mar 2016 19:13:47 +0100 Received: by nautica.notk.org (Postfix, from userid 1003) id 8D493C01D; Wed, 9 Mar 2016 19:13:46 +0100 (CET) Date: Wed, 9 Mar 2016 19:13:46 +0100 From: Adrien Nader To: Kasper Janssens Cc: "caml-list@inria.fr" Message-ID: <20160309181346.GA27584@notk.org> References: <1CF03778-3645-47D9-A713-4341373801F3@HGST.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1CF03778-3645-47D9-A713-4341373801F3@HGST.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] Profiling ocaml with lwt Hi, I tend to (ab)use strace. It has options to only instrument some syscalls, it can count time spent in syscalls, time spent between syscalls, has microsecond precision, ... My first runs are usually "strace -tt -f -o log" to get times with microseconds, follow forks and write to a file rather than stderr (heavily advised, especially since text editors have syntax highlighting for strace's output [ vim at least even though you need to :set ft=strace when using -tt). After that, you can also use -T to get the time spent in syscalls, -e to trace fewer things, ... It's a hammer and requires a fair bit of eye-crossing but it covers everything, it's overhead isn't that big and it can easily reduce the scope of what you need to look more deeply at. However it's probably useless to try to spend more than 2 hours on a strace's output if you can't find the answer you're looking for.