Topic
3 replies Latest Post - ‏2013-01-16T08:06:18Z by richard.france
SystemAdmin
SystemAdmin
2260 Posts
ACCEPTED ANSWER

Pinned topic Problem using in #pragma attol start_analyse for rtrt

‏2013-01-15T05:39:06Z |
Hi,

I am trying to use the pragma #pragma attol start_analyse to exclude portions of code in a file from instrumentation. If i use the #pragma attol stop_analyse in the beginning of the file and #pragma attol start_analyse at the end, i do not face any issue. But when i want to include some functions in between for instrumentation and use the pragmas as shown below, i get syntax error on compilation:

#pragma attol stop_analyse
func1(arg 1, arg2,..)
{
}
#pragma attol start_analyse
line x: func2(arg 1, arg2,..)
{
}
#pragma attol stop_analyse
func3(arg 1, arg2,..)
{
}
#pragma attol start_analyse
func2(arg 1, arg2,..)
{
}

Syntax error :
TestRT attolcc1 - ERROR: syntax error near * filename,line x
TestRT attolcc1 - ERROR: syntax error near ; filename,line y
TestRT attolcc1 - ERROR: syntax error near ( filename,line z
TestRT attolcc1 - ERROR: syntax error near , filename,line a
TestRT attolcc1 - ERROR: syntax error near * filename,line b
TestRT attolcc1: Cannot recover from earlier errors ...
  • Error code 7

I checked the IBM support pages and tried #pragma attol start_instru too. But the problem is not resolved. Kindly guide.

Thanks,
Lavanya
Updated on 2013-01-16T08:06:18Z at 2013-01-16T08:06:18Z by richard.france
  • richard.france
    richard.france
    771 Posts
    ACCEPTED ANSWER

    Re: Problem using in #pragma attol start_analyse for rtrt

    ‏2013-01-15T07:53:46Z  in response to SystemAdmin
    the #pragma attol stop_analyse must be used to hide some part of the code to the analyser meaning any reference to that code will not be understood, like if you remove that code from the file.

    If you intention is to not instrument some methods, then best way is to use the instrumentor option -EXUNIT=func1,func3
    More over, there are multiple way to exclude instrumentation for parts of code, the best choice of the way to do it, depends on, why to you need to exclude this part:
    you do not want to have their coverage result included in the report, or
    because the code is not understood by the analyser and why, or
    .....

    if the reason is about the 'not understood code' may be the best way would be to update the TDP to fix that issue, or use an other analyser like attolccp instead of attolcc1
    • SystemAdmin
      SystemAdmin
      2260 Posts
      ACCEPTED ANSWER

      Re: Problem using in #pragma attol start_analyse for rtrt

      ‏2013-01-16T07:24:06Z  in response to richard.france
      I want to exclude parts of code from instrumentation because i do not want it to be included in coverage results..
      • richard.france
        richard.france
        771 Posts
        ACCEPTED ANSWER

        Re: Problem using in #pragma attol start_analyse for rtrt

        ‏2013-01-16T08:06:18Z  in response to SystemAdmin
        In that case use -EXUNIT option from command line, or
        settings > Runtime Analysis > selective instrumentation > Unit to be excluded, from studio node settings