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 #if OSCL_HAS_LARGE_FILE_SUPPORT
    00032         uint64 iParam;
    00033 #else
    00034         uint32 iParam;
    00035 #endif
    00036         TOsclFileOffset iParam2;
    00037         uint32 iStartTick;
    00038         uint32 iTotalTicks;
    00039 };
    00040
    00041 enum TOsclFileOp
    00042 {
    00043     EOsclFileOp_Open
    00044     , EOsclFileOp_Close
    00045     , EOsclFileOp_Read
    00046     , EOsclFileOp_Write
    00047     , EOsclFileOp_Seek
    00048     , EOsclFileOp_Tell
    00049     , EOsclFileOp_Size
    00050     , EOsclFileOp_Flush
    00051     , EOsclFileOp_EndOfFile
    00052     , EOsclFileOp_SetSize
    00053     , EOsclFileOp_NativeOpen
    00054     , EOsclFileOp_NativeClose
    00055     , EOsclFileOp_NativeRead
    00056     , EOsclFileOp_NativeWrite
    00057     , EOsclFileOp_NativeSeek
    00058     , EOsclFileOp_NativeTell
    00059     , EOsclFileOp_NativeSize
    00060     , EOsclFileOp_NativeFlush
    00061     , EOsclFileOp_NativeEndOfFile
    00062     , EOsclFileOp_NativeSetSize
    00063     , EOsclFileOp_Last
    00064 };
    00065 static const char* const TOsclFileOpStr[] =
    00066 {
    00067     "Open"
    00068     , "Close"
    00069     , "Read"
    00070     , "Write"
    00071     , "Seek"
    00072     , "Tell"
    00073     , "Size"
    00074     , "Flush"
    00075     , "EndOfFile"
    00076     , "SetSize"
    00077     , "NativeOpen"
    00078     , "NativeClose"
    00079     , "NativeRead"
    00080     , "NativeWrite"
    00081     , "NativeSeek"
    00082     , "NativeTell"
    00083     , "NativeSize"
    00084     , "NativeFlush"
    00085     , "NativeEndOfFile"
    00086     , "NativeSetSize"
    00087     , "???"
    00088 };
    00089
    00090 class PVLogger;
    00091 class Oscl_File;
    00092
    00093 class OsclFileStats
    00094 {
    00095     public:
    00096         OsclFileStats(Oscl_File* c);
    00097         void Start(uint32& aTicks);
    00098         void End(TOsclFileOp aOp, uint32 aStart, uint32 aParam = 0, TOsclFileOffset aParam2 = 0);
    00099         void Log(TOsclFileOp, PVLogger*, uint32);
    00100         void LogAll(PVLogger*, uint32);
    00101
    00102     private:
    00103         Oscl_File* iContainer;
    00104         //fixed array of the max time per item.
    00105         OsclFileStatsItem iStats[EOsclFileOp_Last];
    00106 };
    00107
    00108
    00109
    00110 #endif
    00111