summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-xray/xray-account.cc
Commit message (Collapse)AuthorAgeFilesLines
* [XRay][tools] Rename llvm-xray filenames from .cc -> .cpp (NFC)Dean Michael Berris2018-05-021-510/+0
| | | | | | | | | | | | | | | | Summary: This brings the filenames in accordance to the style guide and LLVM conventions for C++ filenames. As suggested by rnk@ in D46068. Reviewers: rnk Subscribers: mgorny, mgrang, llvm-commits Differential Revision: https://reviews.llvm.org/D46301 llvm-svn: 331321
* [tools] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-04-011-67/+67
| | | | | | | | | | | | | | | | | | | | | | Summary: r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort. Refer the comments section in D44363 for a list of all the required patches. Reviewers: JDevlieghere, zturner, echristo, dberris, friss Reviewed By: echristo Subscribers: gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D45141 llvm-svn: 328943
* [XRay] fix 99th percentile lookups by sorting the array correctlyMartin Pelikan2018-01-301-2/+5
| | | | | | | | | | | | | | Summary: It was a copy-paste typo, sorting only to the 90th percentile twice. Now, it only sorts the array prefix once, and extracts what we need. Reviewers: dberris, kpw, eizan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42690 llvm-svn: 323800
* [XRay] fix the -Werror build by handling all enum cases in switchesMartin Pelikan2017-09-271-0/+3
| | | | | | Followup to D32840. llvm-svn: 314270
* [XRay] convert FDR arg1 log entriesMartin Pelikan2017-09-271-1/+2
| | | | | | | | | | | | | | | | | | | | Summary: A new FDR metadata record will support logging a function call argument; appending multiple metadata records will represent a sequence of arguments meaning that "holes" are not representable by the buffer format. Each call argument is currently a 64-bit value (useful for "this" pointers and synchronization objects). If present, we put this argument to the function call "entry" record it belongs to, and alter its type to notify the user of its presence. Reviewers: dberris Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32840 llvm-svn: 314269
* [XRay][tools] Support tail-call exits before we write them in the runtimeDean Michael Berris2017-09-181-1/+5
| | | | | | | | | | | | | | | | | Summary: This change adds support for explicit tail-exit records to be written by the XRay runtime. This lets us differentiate the tail exit records/events in the log, and allows us to treat those exit events especially in the future. For now we allow printing those out in YAML (and reading them in). Reviewers: kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37964 llvm-svn: 313514
* [XRay][tools] Fix an accounting bug in llvm-xray accountDean Michael Berris2017-08-311-3/+31
| | | | | | | | | | | | | | | | | | Summary: Before this patch, llvm-xray account will assume that thread stacks will not be empty. Unfortunately there are cases where an instrumented function will see a call to `fork()` which will cause the child process to not see the start of the function, but only see the end of the function. The tooling cannot assume that threads will always have perfect stacks, and so we change it to support this reality. Reviewers: dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31870 llvm-svn: 312204
* [XRay] Define the InstrumentationMap typeDean Michael Berris2017-02-011-55/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change implements the instrumentation map loading library which can understand both YAML-defined instrumentation maps, and ELF 64-bit object files that have the XRay instrumentation map section. We break it out into a library on its own to allow for other applications to deal with the XRay instrumentation map defined in XRay-instrumented binaries. This type provides both raw access to the logical representation of the instrumentation map entries as well as higher level functions for converting a function ID into a function address. At this point we only support ELF64 binaries and YAML-defined XRay instrumentation maps. Future changes should extend this to support 32-bit ELF binaries, as well as other binary formats (like MachO). As part of this change we also migrate all uses of the extraction logic that used to be defined in tools/llvm-xray/ to use this new type and interface for loading from files. We also remove the flag from the `llvm-xray` tool that required users to specify the type of the instrumentation map file being provided to instead make the library auto-detect the file type. Reviewers: dblaikie Subscribers: mgorny, varno, llvm-commits Differential Revision: https://reviews.llvm.org/D29319 llvm-svn: 293721
* xray-account: Avoid std::errc::bad_message to appease mingw.NAKAMURA Takumi2017-01-131-1/+1
| | | | llvm-svn: 291863
* Avoid std::errc::protocol_* to appease mingwHans Wennborg2017-01-121-1/+1
| | | | | | Like r291636 and r285261. llvm-svn: 291786
* Fix windows buildbots building llvm-xraySimon Pilgrim2017-01-121-5/+5
| | | | | | | | | | 2 issues: 1 - replaced unix-style pid_t with cross-platform llvm::sys::ProcessInfo::ProcessId 2 - fixed shadow variable warning in lambda expression Reviewed by @filcab llvm-svn: 291760
* [XRay] Include <numeric> for std::accumulate.Dean Michael Berris2017-01-121-0/+1
| | | | | | Fix-up following D24377. llvm-svn: 291750
* [XRay] Implement the `llvm-xray account` subcommandDean Michael Berris2017-01-121-0/+484
Summary: This is the third of a multi-part change to implement subcommands for the `llvm-xray` tool. Here we define the `account` subcommand which does simple function call accounting, generating basic statistics on function calls we find in an XRay log/trace. We support text output and csv output for this subcommand. This change also supports sorting, summing, and filtering the top N results. Part of this tool will later be turned into a library that could be used for basic function call accounting. Depends on D24376. Reviewers: dblaikie, echristo Subscribers: mehdi_amini, dberris, beanz, llvm-commits Differential Revision: https://reviews.llvm.org/D24377 llvm-svn: 291749
OpenPOWER on IntegriCloud