| #
cd880010
|
| 26-Dec-2025 |
Dimitry Andric <dim@FreeBSD.org> |
pmcannotate: avoid accessing uninitialized local variables
Initialize `tbfl` and `tofl` to NULL, and check whether they are non-NULL before calling remove(3) on them, to avoid warnings from clang 21
pmcannotate: avoid accessing uninitialized local variables
Initialize `tbfl` and `tofl` to NULL, and check whether they are non-NULL before calling remove(3) on them, to avoid warnings from clang 21 similar to:
usr.sbin/pmcannotate/pmcannotate.c:746:3: error: variable 'tbfl' is uninitialized when used here [-Werror,-Wuninitialized] 746 | FATAL(exec, "%s: Impossible to locate the binary file\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 747 | exec); | ~~~~~ usr.sbin/pmcannotate/pmcannotate.c:57:9: note: expanded from macro 'FATAL' 57 | remove(tbfl); \ | ^~~~ usr.sbin/pmcannotate/pmcannotate.c:695:12: note: initialize the variable 'tbfl' to silence this warning 695 | char *tbfl, *tofl, *tmpdir; | ^ | = NULL usr.sbin/pmcannotate/pmcannotate.c:746:3: error: variable 'tofl' is uninitialized when used here [-Werror,-Wuninitialized] 746 | FATAL(exec, "%s: Impossible to locate the binary file\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 747 | exec); | ~~~~~ usr.sbin/pmcannotate/pmcannotate.c:58:9: note: expanded from macro 'FATAL' 58 | remove(tofl); \ | ^~~~ usr.sbin/pmcannotate/pmcannotate.c:695:19: note: initialize the variable 'tofl' to silence this warning 695 | char *tbfl, *tofl, *tmpdir; | ^ | = NULL
MFC after: 3 days
show more ...
|
| #
de112993
|
| 14-Jan-2025 |
John Baldwin <jhb@FreeBSD.org> |
pmcannotate: Add a '-m' mode option to control per-line annotations.
- "block" (the default mode) displays per-block percentages in front of each annotated line.
- "global" displays a global per
pmcannotate: Add a '-m' mode option to control per-line annotations.
- "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
show more ...
|
| #
4d65a7c6
|
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
usr.sbin: Automated cleanup of cdefs and other formatting
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.
usr.sbin: Automated cleanup of cdefs and other formatting
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
show more ...
|
| #
1d386b48
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| #
4d846d26
|
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
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
show more ...
|
| #
73702c39
|
| 14-Jun-2022 |
John Baldwin <jhb@FreeBSD.org> |
pmcannotate: Don't increment end address passed to objdump -d.
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
pmcannotate: Don't increment end address passed to objdump -d.
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
show more ...
|
| #
cd880010
|
| 26-Dec-2025 |
Dimitry Andric <dim@FreeBSD.org> |
pmcannotate: avoid accessing uninitialized local variables
Initialize `tbfl` and `tofl` to NULL, and check whether they are non-NULL before calling remove(3) on them, to avoid warnings from clang 21
pmcannotate: avoid accessing uninitialized local variables
Initialize `tbfl` and `tofl` to NULL, and check whether they are non-NULL before calling remove(3) on them, to avoid warnings from clang 21 similar to:
usr.sbin/pmcannotate/pmcannotate.c:746:3: error: variable 'tbfl' is uninitialized when used here [-Werror,-Wuninitialized] 746 | FATAL(exec, "%s: Impossible to locate the binary file\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 747 | exec); | ~~~~~ usr.sbin/pmcannotate/pmcannotate.c:57:9: note: expanded from macro 'FATAL' 57 | remove(tbfl); \ | ^~~~ usr.sbin/pmcannotate/pmcannotate.c:695:12: note: initialize the variable 'tbfl' to silence this warning 695 | char *tbfl, *tofl, *tmpdir; | ^ | = NULL usr.sbin/pmcannotate/pmcannotate.c:746:3: error: variable 'tofl' is uninitialized when used here [-Werror,-Wuninitialized] 746 | FATAL(exec, "%s: Impossible to locate the binary file\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 747 | exec); | ~~~~~ usr.sbin/pmcannotate/pmcannotate.c:58:9: note: expanded from macro 'FATAL' 58 | remove(tofl); \ | ^~~~ usr.sbin/pmcannotate/pmcannotate.c:695:19: note: initialize the variable 'tofl' to silence this warning 695 | char *tbfl, *tofl, *tmpdir; | ^ | = NULL
MFC after: 3 days
show more ...
|
| #
de112993
|
| 14-Jan-2025 |
John Baldwin <jhb@FreeBSD.org> |
pmcannotate: Add a '-m' mode option to control per-line annotations.
- "block" (the default mode) displays per-block percentages in front of each annotated line.
- "global" displays a global per
pmcannotate: Add a '-m' mode option to control per-line annotations.
- "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
show more ...
|
| #
4d65a7c6
|
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
usr.sbin: Automated cleanup of cdefs and other formatting
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.
usr.sbin: Automated cleanup of cdefs and other formatting
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
show more ...
|
| #
1d386b48
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| #
4d846d26
|
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
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
show more ...
|
| #
73702c39
|
| 14-Jun-2022 |
John Baldwin <jhb@FreeBSD.org> |
pmcannotate: Don't increment end address passed to objdump -d.
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
pmcannotate: Don't increment end address passed to objdump -d.
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
show more ...
|
| #
b4cc0838
|
| 18-May-2018 |
Andrew Gallatin <gallatin@FreeBSD.org> |
Teach pmcannotate about $TMPDIR and _PATH_TMP
Convert pmcannotate to using $TMPDIR and _PATH_TMP rather than hard coding /tmp for temporary files. Pmcannotate sometimes needs quite a lot of space t
Teach pmcannotate about $TMPDIR and _PATH_TMP
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
show more ...
|
| #
1de7b4b8
|
| 27-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
various: general adoption of SPDX licensing ID tags.
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
various: general adoption of SPDX licensing ID tags.
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.
show more ...
|
| #
ee7b0571
|
| 19-Aug-2014 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Merge head from 7/28
|
| #
6cec9cad
|
| 03-Jun-2014 |
Peter Grehan <grehan@FreeBSD.org> |
MFC @ r266724
An SVM update will follow this.
|
| #
414fdaf0
|
| 21-May-2014 |
Alan Somers <asomers@FreeBSD.org> |
IFC @266473
|
| #
04abf5f1
|
| 15-May-2014 |
John-Mark Gurney <jmg@FreeBSD.org> |
make a note that FNBUFF cannot overflow as long as LNBUFF is smaller..
MFC after: 2 weeks
|
| #
caaeeed4
|
| 15-May-2014 |
George V. Neville-Neil <gnn@FreeBSD.org> |
Extend the size of the function or symbol that can be annotated.
MFC after: 2 weeks
|
| #
d1d01586
|
| 05-Sep-2013 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Merge from head
|
| #
40f65a4d
|
| 07-Aug-2013 |
Peter Grehan <grehan@FreeBSD.org> |
IFC @ r254014
|
| #
552311f4
|
| 17-Jul-2013 |
Xin LI <delphij@FreeBSD.org> |
IFC @253398
|
| #
cfe30d02
|
| 19-Jun-2013 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Merge fresh head.
|
| #
28a83c9f
|
| 06-May-2013 |
Hiren Panchasara <hiren@FreeBSD.org> |
objdump output changed indentation from 1 space to 2 spaces somewhere between FreeBSD9 and CURRENT. Removing this rather unnecessary check which expects the second character of assembly line to be a
objdump output changed indentation from 1 space to 2 spaces somewhere between 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
show more ...
|
| #
b4cc0838
|
| 18-May-2018 |
Andrew Gallatin <gallatin@FreeBSD.org> |
Teach pmcannotate about $TMPDIR and _PATH_TMP
Convert pmcannotate to using $TMPDIR and _PATH_TMP rather than hard coding /tmp for temporary files. Pmcannotate sometimes needs quite a lot of space t
Teach pmcannotate about $TMPDIR and _PATH_TMP
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
show more ...
|