Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# oscl_file_stats.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00003
    00004 //                     O S C L _ F I L E  _ STATS
    00005
    00006 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00007
    00019 #ifndef OSCL_FILE_STATS_H_INCLUDED
    00020 #define OSCL_FILE_STATS_H_INCLUDED
    00021
    00022 #include "oscl_base.h"
    00023 #include "osclconfig_io.h"
    00024
    00025 #define OSCL_FILE_STATS_LOGGER_NODE "OsclFileStats"
    00026
    00027 class OsclFileStatsItem
    00028 {
    00029     public:
    00030         uint32 iOpCount;
    00031         uint64 iParam;
    00032         TOsclFileOffset iParam2;
    00033         uint32 iStartTick;
    00034         uint32 iTotalTicks;
    00035 };
    00036
    00037 enum TOsclFileOp
    00038 {
    00039     EOsclFileOp_Open
    00040     , EOsclFileOp_Close
    00041     , EOsclFileOp_Read
    00042     , EOsclFileOp_Write
    00043     , EOsclFileOp_Seek
    00044     , EOsclFileOp_Tell
    00045     , EOsclFileOp_Size
    00046     , EOsclFileOp_Flush
    00047     , EOsclFileOp_EndOfFile
    00048     , EOsclFileOp_SetSize
    00049     , EOsclFileOp_NativeOpen
    00050     , EOsclFileOp_NativeClose
    00051     , EOsclFileOp_NativeRead
    00052     , EOsclFileOp_NativeWrite
    00053     , EOsclFileOp_NativeSeek
    00054     , EOsclFileOp_NativeTell
    00055     , EOsclFileOp_NativeSize
    00056     , EOsclFileOp_NativeFlush
    00057     , EOsclFileOp_NativeEndOfFile
    00058     , EOsclFileOp_NativeSetSize
    00059     , EOsclFileOp_Last
    00060 };
    00061 static const char* const TOsclFileOpStr[] =
    00062 {
    00063     "Open"
    00064     , "Close"
    00065     , "Read"
    00066     , "Write"
    00067     , "Seek"
    00068     , "Tell"
    00069     , "Size"
    00070     , "Flush"
    00071     , "EndOfFile"
    00072     , "SetSize"
    00073     , "NativeOpen"
    00074     , "NativeClose"
    00075     , "NativeRead"
    00076     , "NativeWrite"
    00077     , "NativeSeek"
    00078     , "NativeTell"
    00079     , "NativeSize"
    00080     , "NativeFlush"
    00081     , "NativeEndOfFile"
    00082     , "NativeSetSize"
    00083     , "???"
    00084 };
    00085
    00086 class PVLogger;
    00087 class Oscl_File;
    00088
    00089 class OsclFileStats
    00090 {
    00091     public:
    00092         OsclFileStats(Oscl_File* c);
    00093         void Start(uint32& aTicks);
    00094         void End(TOsclFileOp aOp, uint32 aStart, uint32 aParam = 0, TOsclFileOffset aParam2 = 0);
    00095         void Log(TOsclFileOp, PVLogger*, uint32);
    00096         void LogAll(PVLogger*, uint32);
    00097
    00098     private:
    00099         Oscl_File* iContainer;
    00100         //fixed array of the max time per item.
    00101         OsclFileStatsItem iStats[EOsclFileOp_Last];
    00102 };
    00103
    00104
    00105
    00106 #endif
    00107