#ifndef _SECSIGNPOST_H_
#define _SECSIGNPOST_H_
#include <CoreFoundation/CoreFoundation.h>
#if !TARGET_IPHONE_SIMULATOR
#import <System/sys/kdebug.h>
#endif
static unsigned int SecSignpostComponent = 82;
typedef CF_ENUM(unsigned int, SecSignpostType) {
SecSignpostRestoreKeychain = 0,
SecSignpostRestoreOpenKeybag = 2,
SecSignpostUnlockKeybag = 4,
SecSignpostBackupKeychain = 6,
SecSignpostBackupOpenKeybag = 8,
SecSignpostUpgradePhase1 = 10,
SecSignpostUpgradePhase2 = 12,
SecSignpostBackupKeychainBackupable = 14,
SecSignpostRestoreKeychainBackupable = 16,
SecSignpostSecItemAdd = 18,
SecSignpostSecItemUpdate = 20,
SecSignpostSecItemDelete = 22,
SecSignpostSecItemCopyMatching = 24,
SecSignpostImpulse = 0x1000,
SecSignpostImpulseBackupClassCount = 0x1001,
SecSignpostImpulseRestoreClassCount = 0x1002,
};
static inline void SecSignpostStart(SecSignpostType type) {
#if !TARGET_IPHONE_SIMULATOR
kdebug_trace(ARIADNEDBG_CODE(SecSignpostComponent, type + 0), 0, 0, 0, 0);
#endif
}
static inline void SecSignpostStop(SecSignpostType type) {
#if !TARGET_IPHONE_SIMULATOR
kdebug_trace(ARIADNEDBG_CODE(SecSignpostComponent, type + 1), 0, 0, 0, 0);
#endif
}
static inline void SecSignpostBackupCount(SecSignpostType type,
CFStringRef cls,
CFIndex count,
unsigned filter) {
#if !TARGET_IPHONE_SIMULATOR
if (CFStringGetLength(cls) != 4)
return;
unsigned char ucls[5];
if (!CFStringGetCString(cls, (char *)ucls, sizeof(ucls), kCFStringEncodingUTF8))
return;
uint32_t c = (ucls[0] & 0xff) | (ucls[1] << 8) | (ucls[2] << 16) | (ucls[3] << 24);
kdebug_trace(ARIADNEDBG_CODE(SecSignpostComponent, type), c, count, filter, 0);
#endif
}
#endif