aboutsummaryrefslogtreecommitdiff
path: root/tools/proftool.c
AgeCommit message (Collapse)Author
2023-03-22proftool: Remove unused variables in make_flame_treeTom Rini
With clang-15 we now get reported that in the make_flame_tree function, neither the missing_count nor depth variables are used, only incremenete/decremented. Remove these. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Provide a flamegraph that uses timingSimon Glass
Add a second variant of the flame graph that shows records in terms of the number of microseconds used by each call stack. This is a useful way of seeing where time is going within the execution of U-Boot. This requires a call stack that records the start time of each function, as well as a way of subtracting all time consumed by child functions, so that this time is not counted twice by the flamegraph. The time values in the output are just for the function itself, not for its children. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Support output of a flamegraphSimon Glass
It is useful to see how many times each function is called, particularly in the context of its callers. A flamegraph is a way of showing this. Support output in this format which can be used by the flamegraph.pl script, to generate an SVG image for browsing. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Support output of funcgraph recordsSimon Glass
Add support for writing ftrace records in the 'funcgraph' format, which shows function entry and exit points as well as the time taken by each function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Use text_base from the trace headerSimon Glass
Use the information in the trace header instead of reading it from the trace records. Add debugging to check that System.map and the trace header agree on this value. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Drop use of objsectionSimon Glass
This feature was only partly implemented and serves no current purpose. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Update proftool to use new binary formatSimon Glass
The old text format is not much used anymore. Instead a new trace-cmd tool has introduced a binary format for trace records. Add support for generating this format. This involves removing the old text format, adding various helpers for the new format and adjusting the code to use an output file instead of stdout. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Rename prof to trace and improve commentsSimon Glass
The current use of 'profile' in some places is confusing. Update the code to use the word 'trace' consistently. Change the flags to better match their meaning and add some more comments. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18trace: Update trace-format generator for newer versionSimon Glass
This now includes flags and the layout has changed slightly in recent versions of Linux. Update the generator accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18trace: Adjust flags in proftoolSimon Glass
The flags in this tool don't match the comments or help. Also the variable names are quite confusing. Update them for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18command: Remove the cmd_tbl_t typedefSimon Glass
We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10trace: do not limit trace buffer to 2GiBHeinrich Schuchardt
There is no good reason to limit the trace buffer to 2GiB on a 64bit system. Adjust the types of the relevant parameters. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2015-11-16tools/proftool: fix use-after-freeVincent Stehlé
The read_trace_config() can dereference the line pointer after freeing it on its error path. Avoid that. This was found by Coverity Scan. Signed-off-by: Vincent Stehlé <vincent.stehle@freescale.com> Cc: Simon Glass <sjg@chromium.org>
2015-05-08Fix musl buildJörg Krause
This patch fixes cross-compiling U-Boot tools with the musl C library: * including <sys/types.h> is needed for ulong * defining _GNU_SOURCE is needed for loff_t Tested for target at91sam9261ek_dataflash_cs3. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks> Cc: Tom Rini <trini@konsulko.com>
2013-07-24Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
2013-07-03tools/proftool: remove REG_NOERRORAndreas Bießmann
Remove non portable usage of REG_NOERROR. BSD (like OS X) variants of regex.h do not declare REG_NOERROR, even GNU regex(3) does not mention REG_NOERROR, just remove it. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Acked-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2013-06-26Add proftool to decode profile dataSimon Glass
This tool provides the facility to decode U-Boot trace data and write out a text file in Linux ftrace format for use with pytimechart. Signed-off-by: Simon Glass <sjg@chromium.org>