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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id F0C137ED25 for ; Fri, 12 Jul 2013 15:46:51 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of mark@three-tuns.net) identity=pra; client-ip=93.93.131.93; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mark@three-tuns.net"; x-sender="mark@three-tuns.net"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of mark@three-tuns.net) identity=mailfrom; client-ip=93.93.131.93; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mark@three-tuns.net"; x-sender="mark@three-tuns.net"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mash.three-tuns.net) identity=helo; client-ip=93.93.131.93; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mark@three-tuns.net"; x-sender="postmaster@mash.three-tuns.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj4SALEH4FFdXYNd/2dsb2JhbABAGoMGNBCCXL86gQMWdIJkezQFKIhHCDOWNqBCj34Yg0kDl1uBKpAkgxM7 X-IPAS-Result: Aj4SALEH4FFdXYNd/2dsb2JhbABAGoMGNBCCXL86gQMWdIJkezQFKIhHCDOWNqBCj34Yg0kDl1uBKpAkgxM7 X-IronPort-AV: E=Sophos;i="4.89,653,1367964000"; d="scan'208";a="21009237" Received: from mash.three-tuns.net ([93.93.131.93]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 12 Jul 2013 15:46:51 +0200 Received: from mark by mash.three-tuns.net with local (Exim 4.80) (envelope-from ) id 1UxdgQ-000274-Ht for caml-list@yquem.inria.fr; Fri, 12 Jul 2013 14:46:50 +0100 Date: Fri, 12 Jul 2013 14:46:50 +0100 From: Mark Shinwell To: caml-list@yquem.inria.fr Message-ID: <20130712134650.GG15268@three-tuns.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Validation-by: mark@three-tuns.net Subject: [Caml-list] enhancements for "perf" on OCaml code Linux has a tool called "perf" that enables the display of source code alongside time profiling information and the corresponding assembly code. (See https://perf.wiki.kernel.org/index.php/Tutorial, "perf annotate"). I am pleased to announce an alpha version of the OCaml native code compiler that permits perf to do the same for OCaml code. This compiler works only on x86-64 Linux, although porting it to other Linux targets should be straightforward. The compiler is available in OPAM. If you add the remote repository git://github.com/mshinwell/opam-repo-dev then you should be able to "opam switch" to the 4.01-perf-annotate compiler. Please let me have any reports of problems. After compilation, you can run "perf record" to gather data about your OCaml program, and then use "perf report" to interactively examine it. If you hit Return on a function, then you should be given the option to annotate it, and then you should see the OCaml code as above. Note that line number information is not yet as fine-grained for OCaml as it might be for C code. You need to have the source files available at the same location on the filesystem when you run "perf report" as you did when you compiled the program. This work forms part of a larger project in collaboration with OCaml Labs at Cambridge, UK, to enhance the level of debugging information emitted by the OCaml compiler. The perf-annotate compiler emits debugging sections that aim to be compliant with the DWARF-2 standard. Mark P.S. The eagle-eyed of you will notice that there is another compiler, 4.01-allocation-profiling, also available in that OPAM repo. This provides allocation profiling capabilities for native code, documentation for which I will endeavour to circulate to the list shortly.