kernel/eka/include/kernperflogger.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Definition of some macros that can be used for simple profiling device drivers etc. They are for use from kernel side only.
       
    15 // The macros create timestamped entries in the BTrace log buffer, see <e32BTrace.h> for details.
       
    16 // Note that for the succcessfull logging category BTrace::EKernPerfLog shall be enabled along with whole tracing.
       
    17 // See "BTrace" and "BTracemode" keywords in appropriate "header.iby" file.
       
    18 // 
       
    19 //
       
    20 
       
    21 /**
       
    22  @file
       
    23  @publishedPartner
       
    24  @released
       
    25 */
       
    26 
       
    27 #ifndef KERN_PERF_LOGGER_H
       
    28 #define KERN_PERF_LOGGER_H
       
    29 
       
    30 
       
    31 #ifdef __KERNEL_MODE__
       
    32 
       
    33 #include <e32btrace.h>
       
    34 
       
    35 
       
    36 /*
       
    37 Logging with zero user data parameters.
       
    38 The trace will consist of: Fast Counter Timestamp, Context, PC value and Tick Count
       
    39 
       
    40 @param  aSubCategory    8-bit  integer that specifies logging subcategory. Logging category is BTrace::EKernPerfLog
       
    41 */
       
    42 #define PERF_LOG0(aSubCategory)  BTraceContextPc4(BTrace::EKernPerfLog, (aSubCategory), NKern::TickCount())
       
    43 
       
    44 
       
    45 /*
       
    46 Logging with one user data word parameter.
       
    47 The trace will consist of: Fast Counter Timestamp, Context, PC value, aUserData value and Tick Count
       
    48 
       
    49 
       
    50 @param  aSubCategory    8-bit  integer that specifies logging subcategory. Logging category is BTrace::EKernPerfLog
       
    51 @param  aUserData       32-bit user data
       
    52 */
       
    53 #define PERF_LOG1(aSubCategory,aUserData)   BTraceContextPc8(BTrace::EKernPerfLog, (aSubCategory), (aUserData),  NKern::TickCount())
       
    54 
       
    55 
       
    56 /*
       
    57 Logging with 2 user data words parameters.
       
    58 The trace will consist of: Fast Counter Timestamp, Context, PC value, aUserData, aUserData2 values and Tick Count
       
    59 
       
    60 
       
    61 @param  aSubCategory    8-bit  integer that specifies logging subcategory. Logging category is BTrace::EKernPerfLog
       
    62 @param  aUserData       32-bit user data, word 1
       
    63 @param  aUserData2      32-bit user data, word 2
       
    64 */
       
    65 #define PERF_LOG2(aSubCategory,aUserData,aUserData2)   BTraceContextPc12(BTrace::EKernPerfLog, (aSubCategory), (aUserData), (aUserData2), NKern::TickCount())
       
    66 
       
    67 
       
    68 /** default trace, just for simplicity */
       
    69 #define PERF_LOG PERF_LOG2
       
    70 
       
    71 
       
    72 
       
    73 #endif //__KERNEL_MODE__
       
    74 
       
    75 #endif //KERN_PERF_LOGGER_H
       
    76 
       
    77