aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pmcannotate/pmcannotate.c
Commit message (Collapse)AuthorAgeFilesLines
* pmcannotate: Add a '-m' mode option to control per-line annotations.John Baldwin2025-01-141-8/+46
| | | | | | | | | | | | | - "block" (the default mode) displays per-block percentages in front of each annotated line. - "global" displays a global percentage in front of each line. - "raw" displays the raw count of sample hits in front of each line. Reviewed by: Pau Amma <pauamma@gundo.com>, mav Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D35401
* usr.sbin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* pmcannotate: Don't increment end address passed to objdump -d.John Baldwin2022-06-141-5/+0
| | | | | | | | | | | | | | | | | | | | | libpmc already returns an end address that is after the end of the last instruction of a function (on both amd64 and arm64) as the end address written to the annotate map file is computed as the start address of the symbol plus the size. Adding one could result in a curious failure where an entire function's contents in assembly was reduced instead to only the first instruction. The reason is that when the end instruction is bumped by one, objdump -d can append the first instruction of the next function in its output. However, since pmcannotate concatenates all of the objdump -d output from various functions into a single file which it then searches to find the assembly for a given file, if this additional trailer was earlier in the file than the full function, the trailer was chosen to represent the entire function resulting in the truncated listing of the function. Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D35399
* Teach pmcannotate about $TMPDIR and _PATH_TMPAndrew Gallatin2018-05-181-2/+15
| | | | | | | | | | | | | Convert pmcannotate to using $TMPDIR and _PATH_TMP rather than hard coding /tmp for temporary files. Pmcannotate sometimes needs quite a lot of space to store the output from objdump, and will fail in odd ways if that output is truncated due to lack of space in /tmp. Reviewed by: jtl Sponsored by: Netflix Notes: svn path=/head/; revision=333793
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* make a note that FNBUFF cannot overflow as long as LNBUFF is smaller..John-Mark Gurney2014-05-151-0/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=266173
* Extend the size of the function or symbol that can be annotated.George V. Neville-Neil2014-05-151-2/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=266166
* objdump output changed indentation from 1 space to 2 spaces somewhere betweenHiren Panchasara2013-05-061-2/+0
| | | | | | | | | | | | | | | FreeBSD9 and CURRENT. Removing this rather unnecessary check which expects the second character of assembly line to be a hex number to make pmcannotate actually annotate the code and assembly. PR: 165654 Submitted by: Vitaly Magerya <vmagerya@gmail.com> Reviewed by: attilio Approved by: sbruno (mentor) MFC after: 3 weeks Notes: svn path=/head/; revision=250304
* Fix a grammatical error connected to the previous commit.Benedict Reuschling2010-10-161-1/+1
| | | | | | | Spotted by: gjb@ Notes: svn path=/head/; revision=213928
* Correct some typos in comments, no functional changes.Benedict Reuschling2010-10-161-1/+1
| | | | Notes: svn path=/head/; revision=213927
* ANSIfy almost all applications that use WARNS=6.Ed Schouten2009-12-291-2/+2
| | | | | | | | | | I was considering committing all these patches one by one, but as discussed with brooks@, there is no need to do this. If we ever need/want to merge these changes back, it is still possible to do this per application. Notes: svn path=/head/; revision=201227
* Import an initial revision of the pmcannotate tool.Attilio Rao2008-11-261-0/+804
For further explanations please check this e-mail on freebsd-arch@: http://lists.freebsd.org/pipermail/freebsd-arch/2008-November/008698.html Tested by: gnn Sponsored by: Nokia Notes: svn path=/head/; revision=185347