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