# gcda2mplprofdata **Repository Path**: openarkcompiler-incubator/gcda2mplprofdata ## Basic Information - **Project Name**: gcda2mplprofdata - **Description**: gcda2mplprofdata - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2022-07-22 - **Last Updated**: 2024-06-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README gcda2mprofdata --- convert gnu's .gcda file format to Maple's .mprofdata format Build steps: ----------- 1. Set MAPLE_ROOT and build type: cd to your OpenArkCompiler directory source build/envsetup.sh arm release/debug 2. Set up link to namemangler.cpp file in OpenArkCompiler: cd to your gcda2mprofdata directory make setup 3. Build gcda2mprofdata in current directory and install in $MAPLE_EXECUTE_BIN: make Tool usage: ----------- 1. To see command options: gcda2mprofdata -help Output: usage: ./gcda2mprofdata [-show] [-dir=] [.gcda] -show : dump maple profile data when converting -dir=path: convert all .gcda files in directory to .mprofdata .gcda : single or serverl gcda files 2. Converting .gcda file to .mprofdata file: gcda2mprofdata ./test/foo.gcda [Can specify any number of .gcda files. The output .mprofdata will be put in the same directory as each .gcda file.] gcda2mprofdata -dir=./test [All .gcda files in the give directory will be converted.] 3. To show contents of mprofdata file while converting gcda: gcda2mprofdata -show ./test/foo.gcda Implementation notes: -------------------- A. Folder gcc-linary-7.5/gcc are files copied from gcc-linary-7.5/gcc. They are needed for parsing .gcda files. gcov-counter.def: defined the count MACROs gcov-io.c/h: defined the gcda data structures and read functions mpl_profdata_export.h/cpp B. gcda2mprofdata is implemented by the following files: profdata.h: defined the internal data structures for maple profile data profdata.cpp: the dump functions for maple profile data gcda_parser.h/cpp: defined a wrapper class to parse gcda file and store in maple profile data form; it includes gcov-io.h and gcov-io.c. mpl_profdata_export.h/cpp: write out .mprofdata file driver.cpp: the main routine C. To dump .gcda file: use gcov-dump from $MAPLE_ROOT/tools/gcc-linaro-7.5.0/bin: aarch64-linux-gnu-gcov-dump foo.gcda