1    /* 
     2     * Copyright (c) 2010, Texas Instruments Incorporated
     3     * All rights reserved.
     4     *
     5     * Redistribution and use in source and binary forms, with or without
     6     * modification, are permitted provided that the following conditions
     7     * are met:
     8     *
     9     * *  Redistributions of source code must retain the above copyright
    10     *    notice, this list of conditions and the following disclaimer.
    11     *
    12     * *  Redistributions in binary form must reproduce the above copyright
    13     *    notice, this list of conditions and the following disclaimer in the
    14     *    documentation and/or other materials provided with the distribution.
    15     *
    16     * *  Neither the name of Texas Instruments Incorporated nor the names of
    17     *    its contributors may be used to endorse or promote products derived
    18     *    from this software without specific prior written permission.
    19     *
    20     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    21     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    22     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    23     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    24     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    25     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    26     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    27     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    28     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    29     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    30     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    31     * 
    32     */
    33    
    34    import xdc.runtime.ITimestampClient;
    35    import xdc.runtime.IGateProvider;
    36    
    37    /*
    38     *  ======== LoggerSysTID.xdc ========
    39     *
    40     */
    41    
    42    /*!
    43     *  ======== LoggerSysTID ========
    44     *  A logger which routes events to the system `printf` function with task ids.
    45     *
    46     *  This logger processes log events as they are generated and routes
    47     *  them through the `{@link System#printf System_printf()}` function.
    48     *  The final disposition of the log event is dependent on which system
    49     *  provider has been assigned to the
    50     *  `{@link System#SupportProxy System.SupportProxy}` configuration parameter.
    51     *
    52     *  Note that the log events are processed within the runtime context
    53     *  of the `{@link Log Log_write()}` or `{@link Log Log_print()}` function
    54     *  that generated the event. It is important to account for the processing
    55     *  overhead and stack usage imposed on the runtime context. The cost of
    56     *  this processing is defined by the implementation of the system provider.
    57     *
    58     *  Note that the only difference between LoggerSysTID and
    59     *  xdc.runtime.LoggerSys is the addition of the task id.
    60     *
    61     *  @a(Examples)
    62     *  Configuration example: The following XDC configuration statements
    63     *  create a logger instance, assign it as the default logger for all
    64     *  modules, and enable `USER1` logging in all modules of the package
    65     *  `my.pkg`. See the `{@link Diags#setMaskMeta Diags.setMaskMeta()}` function
    66     *  for details on specifying the module names.
    67     *
    68     *  @p(code)
    69     *  var Defaults = xdc.useModule('xdc.runtime.Defaults');
    70     *  var Diags = xdc.useModule('xdc.runtime.Diags');
    71     *  var LoggerSysTID = xdc.useModule('xdc.runtime.LoggerSysTID');
    72     *
    73     *  var LoggerSysTIDParams = new LoggerSysTID.Params();
    74     *  Defaults.common$.logger = LoggerSysTID.create(LoggerSysTIDParams);
    75     *  Diags.setMaskMeta("my.pkg.%", Diags.USER1, Diags.RUNTIME_ON);
    76     *  @p
    77     */
    78    
    79    @Gated
    80    
    81    module LoggerSysTID inherits xdc.runtime.ILogger {
    82    
    83        /*!
    84         *  ======== ITimestampProxy ========
    85         *  User supplied time-stamp proxy
    86         *
    87         *  This proxy allows `LoggerSys` to use a timestamp server different
    88         *  from the server used by `{@link xdc.runtime.Timestamp}`. However, if
    89         *  not supplied by a user, this proxy defaults to whichever timestamp
    90         *  server is used by `Timestamp`.
    91         */
    92        proxy TimestampProxy inherits ITimestampClient;
    93    
    94        // Get a handle to the module's gate.
    95        config IGateProvider.Handle gate;
    96    
    97    instance:
    98    
    99        /*!
   100         *  ======== create ========
   101         *  Create a `LoggerSysTID` logger
   102         *
   103         *  The logger instance will route all log events it receives to
   104         *  the {@link System#printf} function.
   105         */
   106        create();
   107    
   108    internal:
   109    
   110        struct Instance_State {
   111            Bool enabled;
   112        };
   113    }
   114    /*
   115     *  @(#) ti.sdo.utils.loggers; 1, 0, 0,63; 10-29-2010 17:24:29; /db/atree/library/trees/osal/osal-c12x/src/ xlibrary
   116    
   117     */
   118