This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Codec Engine Trace Mask for DM368

Hello,

I have a codec that uses the general trace utility (or is it generic trace?)

I can start the tracings by doing:

CE_TRACE=*+01234567 ./app

I can also set this in my codec using GT_setLevel.  However, does this override any outside settings?

How can i specify the tracemask for my module in the server configuration file?

I looked at the TraceUtil but I tried including that and got errors about the BIOS, which isn't needed for the DM368.

Do I need to create different profiles?  I saw that there is:

xdc.useModule("ti.sdo.fc.global.Settings").profile = "debug_trace";

Do I need to do something like that?

What I really want to do is always turn warnings and errors on for my module (udpanalytics.module.MODULE+67) but still have the ability to turn all the tracing on at runtime or in the server configuration.

Is this possible?

Matt

  • Matt,

    If the GT_setLevel() function is called after CERuntime_init(), then it should override the CE_TRACE="+01234567" on the command line.  You can call GT_setLevel() or GT_set(), in main() for example.

    You can't specify the trace mask for your module in server configuration.  If you always want to build trace into your module, you do not need to build different libraries (trace enabled, trace disabled) for your module.  If you did want trace enabled / trace disabled libraries, then you would need to build the different profiles, and implement the getLibs() function in the package.xs file for your module, which will choose the appropriate library, depending on the profile that the end user has chosen in configuration.

    If you want to build a library with GT compiled out of your module, build the library with the pre-processor defines: "-DGT_ASSERT=0 -DGT_TRACE=0".  But it sounds like you always want to have trace built in, so you don't need to do that.  All Codec Engine libraries have trace built in, and the user can turn it on and off by setting environment variables, CE_DEBUG or CE_TRACE, or by using GT_set() in code.  Framework Components, on the other hand, has libraries with trace compiled out, which is why you need to use the profiles "trace" or "debug_trace" to get any GT output.

    Best regards,

        Janet

  • Ok thanks Janet,

    I thought doing "+67" would just add levels six and seven to the GT level.

    For example if I did GT_setLevel("udpanalytics.module.MODULE=+67") would add levels 6 and 7 onto whatever the GT level was for that module.

    So if someone specified CE_TRACE="+01234567" at runtime then my codec would be set at levels 0-7 and the GT_setLevel would just add 6-7 (which are already activated)

    This way my codec would always print error and warning information.

  • Matt,

    GT_set("udpanalytics.module.MODULE+67") does just add levels 6 and 7 to what was already set (I'm not sure what GT_setLevel() does, I don't see it in gt.h).  Note that there is no '=' sign in the string passed to GT_set(), just the '+', when you want to add levels.

    Best regards,

        Janet

  • Bonus.  That's exactly what I need.  Thanks Janet!

    I got the setLevel thing wrong, we have a macro wrapper in our code around GT_set().

  • Janet,

    I've have been debugging with the tracing.

    If I do:

    CE_TRACE="udpanalytics.module.MODULE+01234567" ./app.out

    I get all the debugging.  However if I do:

    CE_TRACE="udpanalytics*+01234567" ./app.out

    I don't get the debugging for all of my modules?

    I am doing something wrong?

    Sorry to revive the thread, but it seems more sensible here than in a new thread.

    Matt

  • Matt,

    I don't see any reason why that shouldn't work.  You should get trace for all modules that called GT_create() with a name that started with "udpanalytics".  In the first case, where you set CE_TRACE="udpanalytics.module.MODULE+01234567" you are getting all debugging trace?  Is that the name you are using for all of your modules?  Are there particular modules that you're not getting trace for, or are you not getting all the trace for some modules?  It could be that the trace buffer is wrapping and some trace data is lost.

    Regards,

        Janet

  • So my three codecs are setup like so:

    GT_create( &gtMask, "udpanalytics.module1.MODULE1" );
    GT_set("udpanalytics.module1.MODULE1+67");

    where the number is 1, 2 and 3 say.

    If I do any of the following I get output from that module:

    CE_TRACE="udpanalytics.module1.MODULE1+01234567" ./app.out
    CE_TRACE="udpanalytics.module2.MODULE2+01234567" ./app.out
    CE_TRACE="udpanalytics.module3.MODULE3+01234567" ./app.out

    However,

    CE_TRACE="udpanalytics.*+01234567" ./app.out

    Gives me nothing!

    Seems strange.

    Doing

    CE_TRACE="*+01234567" ./app.out

    Dumps everything out, including my three modules?

    Matt

  • Matt,

    This definitely looks like a problem with GT processing the wildcard, *.  I am able to reproduce this using some of the Codec Engine module names.  For example, if I run

        CE_TRACE="ti.sdo.ce.osal.SemMP+01234567" ./app_local.xv5T

    I get trace for the SemMP module.  However, if I run

        CE_TRACE="ti.sdo.ce.*+01234567" ./app_local.xv5T

    I don't get any trace.  I'll look into this and see if I can track down the problem.

    Thanks,

        Janet

     

  • Matt,

    I have found the source of the problem.  The problem in my example is that CERuntime_init() is calling GT_set(Global_getenv("CE_TRACE")) before any of the Codec Engine and Framework Components modules' init functions are called. This means that the GT list of module names is empty, so the GT_set() call has no affect when passed a specific module name or the prefix of a module name followed by the wildcard.  When only the wildcard is used, GT treats this as a special case, so it works.

    To get trace in my example, I had to move the line

        /* allow user to over-ride via CE_TRACE. */
        GT_set(Global_getenv("CE_TRACE"));

    in the file CERuntime.xdt to after all the init calls in CERuntime_init().  This is a bug that should be fixed in Codec Engine, but the fix will not help in your case.

    In your case, you may be able to get around this by calling your module init functions before CERuntime_init() is called.  (You should also call GT_init() in your modules' init() functions, before any other GT functions are called.)

    Regards,

        Janet

  • I moved the line you said in CERuntime.xdt and recompiled.

    I still didn't get any output with:

    CE_TRACE="udpanalytics.*+01234567" ./app.out

    Can I just do:

    CE_TRACE="udpanalytics.module1.MODULE1=01234567,udpanalytics.module2.MODULE2=01234567,udpanalytics.module3.MODULE3=01234567"

  • Matt,

    Moving the line in CERuntime.xdt would not help in your case, since GT_set(Global_getenv("CE_TRACE")) would still be called before your modules' init() functions. You can do as you said, explicitly setting CE_TRACE to the string with each of your modules.  You can separate the strings with a comma or semi-colon.

    Regards,

        Janet