Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes and improvements to the WMC tool #174

Open
wants to merge 69 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
71cf99b
correction of Python interpreter in findpackage() not supported by la…
malenov Jul 22, 2024
d915d2c
addition of --skip-cmplx-instrumentation command-line option allowing…
malenov Jul 22, 2024
3e7607d
relax 70% upper char condition checking for local macros
malenov Jul 22, 2024
ccb343b
fix bug when WMC tool does not instrument malloc() calls in IF(...) s…
malenov Jul 23, 2024
57ed22b
fixing des-instrumentation of a file that contains print_mem() functi…
malenov Jul 26, 2024
5496cfd
update to version v1.6
malenov Jul 29, 2024
5b31054
when #undef WMC_TOOL_SKIP is missing, automatically assume end of fil…
malenov Jul 29, 2024
ecf2918
call DesInstrument_ROM() for regular files as well
malenov Jul 29, 2024
479d991
add documentation of changes for v1.6
malenov Jul 29, 2024
5e36e14
remove push_indice(), set_indice(), get_indice(), exist_indice(), res…
malenov Sep 13, 2023
2fce427
fix the arguments of the itos() function
malenov Sep 13, 2023
8063685
fix the declaration of the itos() function
malenov Sep 13, 2023
4b228da
- fix NaN printed in the complexity printout for a non-instrumented f…
malenov Sep 13, 2023
2db1ec6
update the reference files wmc_auto.h and wmc_auto.c used in ctest
malenov Sep 13, 2023
f4ff098
fix crash when no #include is present in the .c file
malenov Sep 13, 2023
4df4658
update version to 1.5 and year to 2023
malenov Sep 13, 2023
0c6472c
introduce -f fps command-line option for setting the FRAMES_PER_SECON…
malenov Sep 14, 2023
cd7896d
prevent calling twice push_wmops() when WMOPS_DETAILS is activated
malenov Sep 14, 2023
1c4a14e
raise error if matching #undef WMC_TOOL_SKIP cannot be found
malenov Sep 15, 2023
83ecc3c
Python script for graphical analysis of the memory allocation tree ba…
malenov Sep 15, 2023
154166e
replace printf() with fprintf() for better portability
malenov Sep 15, 2023
2a8f976
fix an EOL problem whjen replacing #define FRAMES_PER_SECOND
malenov Sep 19, 2023
2c1c0a7
introduce dynamic allocation of internal WMOPS buffers and lists (rep…
malenov Sep 19, 2023
209c419
support for counting BASOP complexity
malenov Sep 27, 2023
a93d1b3
new reference files wmc_auto.[c|h] for ctest
malenov Sep 27, 2023
27df890
unifiy macros and functions under WMOPS_FUNCTS_STRING
malenov Sep 27, 2023
88ab429
count PROM size of BASOP functions and operators
malenov Oct 2, 2023
8ec3582
small correction in the help printout
malenov Oct 3, 2023
8c65042
fix warning about incorrect function declaration (missing void keyword)
malenov Oct 3, 2023
a967886
fix incorrect reading of PROM size from .c files containing digits in…
malenov Oct 3, 2023
d2353a3
do not count PROM in skipped regions
malenov Oct 3, 2023
6205420
update ctest files
malenov Oct 3, 2023
4ca1b5b
print error message if #undef WMC_TOOL_SKIP is not found
malenov Oct 3, 2023
dd06209
make sure that PROM size is calculated and inserted in .c files where…
malenov Oct 3, 2023
c6c184d
update PROM size in ctest vectors
malenov Oct 3, 2023
b0566be
add missing instrumentation in L40_mac()
malenov Oct 24, 2023
dc1abb0
Update README.md with MAC OS compile instructions
malenov Oct 24, 2023
012ae89
change default unit ion memory reports from 32b words to bytes
malenov Nov 9, 2023
fc18741
create changelog file
malenov Nov 9, 2023
fc2bedc
formatting in HISTORY.md
malenov Nov 9, 2023
6ac728c
add inv_sqrtf() to the list of intrinsic math functions
malenov Feb 12, 2024
d10e759
update the manual
malenov Feb 26, 2024
688e97c
Typos in wmc_tool.tex
ludomal Mar 12, 2024
a052292
Typos in README.md
ludomal Mar 12, 2024
0d58f8d
recognize "f" float variants of intrinsic mathematical functions (sin…
malenov Mar 13, 2024
9882ebb
add Python requirements file
malenov Mar 13, 2024
ed51c1e
update helper files
malenov Mar 13, 2024
ae8ccf2
add support for frexp() and frexpf() functions at the cost of MISC(2)
malenov Mar 14, 2024
c231647
include the variants of log2() and round() functions
malenov Mar 19, 2024
e7a4a8a
Update wmc_tool.tex
malenov Mar 19, 2024
c780221
update the WMC tool manual with additional info on how to format the …
malenov Mar 20, 2024
dba570a
fix error when des-instrumenting one-line functions
malenov Mar 20, 2024
3e31f8d
fix the limitation of max string literals to 65535 with MSVC 2017 and…
malenov Mar 20, 2024
aadcb10
correction of Python interpreter in findpackage() not supported by la…
malenov Jul 22, 2024
0400207
addition of --skip-cmplx-instrumentation command-line option allowing…
malenov Jul 22, 2024
a0a04f8
relax 70% upper char condition checking for local macros
malenov Jul 22, 2024
09daf1a
fix bug when WMC tool does not instrument malloc() calls in IF(...) s…
malenov Jul 23, 2024
a72aac2
fixing des-instrumentation of a file that contains print_mem() functi…
malenov Jul 26, 2024
70e8f35
update to version v1.6
malenov Jul 29, 2024
1164cb6
when #undef WMC_TOOL_SKIP is missing, automatically assume end of fil…
malenov Jul 29, 2024
c6c4595
call DesInstrument_ROM() for regular files as well
malenov Jul 29, 2024
32845f7
add documentation of changes for v1.6
malenov Jul 29, 2024
cd201a7
Merge branch 'dev' of github.com:malenov/STL into dev
malenov Jul 29, 2024
06607ad
major udate of BASOP operators, corrections to the BASOP complexity c…
malenov Dec 3, 2024
4e83ce9
version update
malenov Dec 3, 2024
b03548b
update of recognized BASOP operators that should NOT be instrumented …
malenov Dec 3, 2024
55d1334
udpate of reference files for ctest
malenov Dec 3, 2024
8f6d561
Merge branch 'openitu:dev' into dev
malenov Dec 6, 2024
7ecb20c
fix the defition of FRAMES_PER_SECOND
malenov Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/wmc_tool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.5)
project(wmc_tool)
include(CTest)

Expand All @@ -10,8 +10,8 @@ if(WIN32)
)
endif()

add_executable(wmc_tool c_parser.cpp output.cpp text_utils.cpp wmc_tool.cpp)
find_package(PythonInterp)
add_executable(wmc_tool parsing_defs.h c_parser.h c_parser.cpp output.h output.cpp text_utils.h text_utils.cpp constants.h wmc_tool.h wmc_tool.cpp)
find_package (Python COMPONENTS Interpreter)

# Testing
file(TO_CMAKE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/test_data TEST_DIR)
Expand Down
10 changes: 10 additions & 0 deletions src/wmc_tool/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,14 @@
* export information about all dynamic allocations/de-allocations occuring during the runtime of the codec to a `.csv` file
* added an exemplary Python script `mem_analysis.py` for graphical analysis and profiling of dynamic memory alloations based on the generated `.csv` file
* added support for counting complexity and PROM size of BASOP operations and BASOP functions within floating-point source code

## v1.5.1

* added the -s (--skip_cmplx_instrumentation) command-line option, which avoids the instrumentation of function bodies. The func_start_ and return_ keywords, along with the remaining functionality, remain unchanged.

## v1.6

* fixed instrumentation issues in encoder.c of the 3GPP EVS codec where malloc() is instrumented and print_mem() is present as well
* when #undef WMC_TOOL_SKIP is missing, automatically assume end of file, but before the last automatically instrumented segment
* the function DesInstrument_ROM() is called in all regular files as well as the file pointed to with the -m command-line argument

365 changes: 244 additions & 121 deletions src/wmc_tool/c_parser.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/wmc_tool/c_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void Free_Pointer_Table_Memory( Pointer_Tbl_def *PointerTable_ptr );
TOOL_ERROR Setup_Regions( Parse_Context_def *ParseContext_ptr, bool verbose );
TOOL_ERROR DesInstrument( Parse_Context_def *ParseContext_ptr, bool keep_manual );
TOOL_ERROR DesInstrument_ROM(Parse_Context_def* ParseCtx_ptr);
TOOL_ERROR Instrument(Parse_Context_def* ParseContext_ptr, bool instr_const);
TOOL_ERROR Instrument(Parse_Context_def* ParseContext_ptr, bool instr_const, bool skip_cmplx_instrum);
TOOL_ERROR Instrument_Const_Data_PROM_Table( Parse_Context_def *ParseContext_ptr, T_FILE_BOOK file_book[], int nRecords );
TOOL_ERROR Finalize( Parse_Context_def *ParseContext_ptr );
TOOL_ERROR Include_Header(Parse_Context_def* ParseContext_ptr, char** ptr_end_preproc_block );
Expand Down
2 changes: 1 addition & 1 deletion src/wmc_tool/test_data/ref/main2.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/*AddedByWMC_Tool*/}
/*AddedByWMC_Tool*/ROM_Size_Lookup_Table Const_Data_PROM_Table[] =
/*AddedByWMC_Tool*/{
/*AddedByWMC_Tool*/ { "out/test*.c", 291, Get_Const_Data_Size_out_test_c },
/*AddedByWMC_Tool*/ { "out/test*.c", 292, Get_Const_Data_Size_out_test_c },
/*AddedByWMC_Tool*/ { "", -1, NULL }
/*AddedByWMC_Tool*/};
/*AddedByWMC_Tool*/#endif
Expand Down
2 changes: 1 addition & 1 deletion src/wmc_tool/test_data/ref/test_basop32.c
Original file line number Diff line number Diff line change
Expand Up @@ -2430,4 +2430,4 @@ Word32 L_msu0 (Word32 L_var3, Word16 var1, Word16 var2) {
#undef WMC_TOOL_SKIP

/* end of file */
/*AddedByWMC_Tool*/ int PROM_Size_Func( test_basop32 ) { return 157; }
/*AddedByWMC_Tool*/ int PROM_Size_Func( test_basop32 ) { return 158; }
Loading