From owner-svn-src-all@freebsd.org Tue May 22 04:45:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5B32EE65F1; Tue, 22 May 2018 04:45:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97D35826D0; Tue, 22 May 2018 04:45:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6079975D1; Tue, 22 May 2018 04:45:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4M4jl7L041560; Tue, 22 May 2018 04:45:47 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4M4jkRD041557; Tue, 22 May 2018 04:45:46 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805220445.w4M4jkRD041557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 22 May 2018 04:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334017 - in head: lib/libpmcstat usr.sbin/pmcstat X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: lib/libpmcstat usr.sbin/pmcstat X-SVN-Commit-Revision: 334017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2018 04:45:48 -0000 Author: mmacy Date: Tue May 22 04:45:46 2018 New Revision: 334017 URL: https://svnweb.freebsd.org/changeset/base/334017 Log: pmcstat: add option to not decode the leaf function in top mode -I will allow the user to see the hot instruction in question as opposed getting the name of the function Modified: head/lib/libpmcstat/libpmcstat.h head/usr.sbin/pmcstat/pmcpl_callgraph.c head/usr.sbin/pmcstat/pmcstat.c Modified: head/lib/libpmcstat/libpmcstat.h ============================================================================== --- head/lib/libpmcstat/libpmcstat.h Tue May 22 04:08:08 2018 (r334016) +++ head/lib/libpmcstat/libpmcstat.h Tue May 22 04:45:46 2018 (r334017) @@ -106,6 +106,7 @@ struct pmcstat_args { #define FLAGS_HAS_CPUMASK 0x00040000 /* -c */ #define FLAG_HAS_DURATION 0x00080000 /* -l secs */ #define FLAG_DO_WIDE_GPROF_HC 0x00100000 /* -e */ +#define FLAG_SKIP_TOP_FN_RES 0x00200000 /* -I */ int pa_required; /* required features */ int pa_pplugin; /* pre-processing plugin */ Modified: head/usr.sbin/pmcstat/pmcpl_callgraph.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_callgraph.c Tue May 22 04:08:08 2018 (r334016) +++ head/usr.sbin/pmcstat/pmcpl_callgraph.c Tue May 22 04:45:46 2018 (r334017) @@ -473,7 +473,7 @@ pmcstat_callgraph_print(void) static void pmcstat_cgnode_topprint(struct pmcstat_cgnode *cg, - int depth, uint32_t nsamples) + int depth __unused, uint32_t nsamples) { int v_attrs, vs_len, ns_len, width, len, n, nchildren; float v; @@ -481,15 +481,15 @@ pmcstat_cgnode_topprint(struct pmcstat_cgnode *cg, struct pmcstat_symbol *sym; struct pmcstat_cgnode **sortbuffer, **cgn, *pcg; - (void) depth; - /* Format value. */ v = PMCPL_CG_COUNTP(cg); snprintf(vs, sizeof(vs), "%.1f", v); v_attrs = PMCSTAT_ATTRPERCENT(v); + sym = NULL; /* Format name. */ - sym = pmcstat_symbol_search(cg->pcg_image, cg->pcg_func); + if (!(args.pa_flags & FLAG_SKIP_TOP_FN_RES)) + sym = pmcstat_symbol_search(cg->pcg_image, cg->pcg_func); if (sym != NULL) { snprintf(ns, sizeof(ns), "%s", pmcstat_string_unintern(sym->ps_name)); Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Tue May 22 04:08:08 2018 (r334016) +++ head/usr.sbin/pmcstat/pmcstat.c Tue May 22 04:45:46 2018 (r334017) @@ -500,7 +500,7 @@ main(int argc, char **argv) CPU_COPY(&rootmask, &cpumask); while ((option = getopt(argc, argv, - "CD:EF:G:M:NO:P:R:S:TWa:c:def:gk:l:m:n:o:p:qr:s:t:vw:z:")) != -1) + "CD:EF:G:IM:NO:P:R:S:TWa:c:def:gk:l:m:n:o:p:qr:s:t:vw:z:")) != -1) switch (option) { case 'a': /* Annotate + callgraph */ args.pa_flags |= FLAG_DO_ANNOTATE; @@ -569,6 +569,9 @@ main(int argc, char **argv) args.pa_plugin = PMCSTAT_PL_GPROF; break; + case 'I': + args.pa_flags |= FLAG_SKIP_TOP_FN_RES; + break; case 'k': /* pathname to the kernel */ free(args.pa_kernel); args.pa_kernel = strdup(optarg);