I am trying to find a metric "Number of function Call Occurrences" in Freeware tool. Here is my expectation description:

"This metric specifies the number of function calls in the body of a function.

Calls through a function pointer are not counted. Calls in unreachable code and calls to standard library functions are counted. assert is considered as a macro and not a function, so it is not counted."

Here are some examples:

Example 1:

unsigned char   test2(unsigned char index);
unsigned char   test3(unsigned char index);

unsigned char   test1(unsigned char index)
    unsigned char   temp;

    if (0 != test2(index))
        temp = test3(test2(index));
        temp = test3(test2(index + 1));

    return (temp);

In this example, the number of call occurrences in test1 is 5 (test2 is 3 times and test3 is 2 times)

I tried to use the SourceMonitor tool but result is 2 instead of 5. Cscope is used in Linux. I am using Windows 10.

Can someone share some freeware tools to collect this metric? Thank you so much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.