tvlogger.h 3.48 KB
/*
 * tvlogger.h
 *
 * Unobtrusive settop logging utility.  This header file contains structures
 * that are used on the settop and server sides.
 *
 *
 * Copyright 1994, Silicon Graphics, Inc.
 * All Rights Reserved.
 *
 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
 * the contents of this file may not be disclosed to third parties, copied or
 * duplicated in any form, in whole or in part, without the prior written
 * permission of Silicon Graphics, Inc.
 *
 * RESTRICTED RIGHTS LEGEND:
 * Use, duplication or disclosure by the Government is subject to restrictions
 * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
 * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
 * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
 * rights reserved under the Copyright Laws of the United States.
 */

#define TV_LOG_NUM_CODES	(8*1024)	/* 8K codes */
#define TV_LOG_MAGIC_NUMBER     0xdabebbec
#define TV_LOG_VERSION  	2

/*
 * Maximum length of string supported by tvLogEventStr.
 * Longer strings will be truncated.
 */
#define TV_LOG_MAX_STR_LEN      128

typedef struct {
    unsigned long	magic;
    unsigned long	version;
} TVLogHeader;

typedef struct {
    unsigned long	time;
    int			tid;
    unsigned short 	code;
    unsigned short 	numargs;
} TVLogEntryHeader;

/*
 * Messages 8182-8191 are reserved for the logger.  These are defined below.
 */

/*
 * The name thread message indicates that a new thread has been spawned,
 * and it gives a name to that thread.  As many arguments as desired may
 * be specified, and they are converted to a string naming the new thread.
 * The uldump program can then take this information and convert tid's to
 * names.
 *
 * Use this message as such:
 *
 * tvLogEvent3 (UL_ENTRY_NAME_THREAD, 3, 'Thre', 'ad n', 'ame');
 *
 * And the current thread will be named "Thread name".  Short names are best
 * as they will be printed on every line that contains log entries from the
 * current thread.
 */
#define UL_ENTRY_NAME_THREAD    8182

/*
 * This message is used for logging thread usage data.
 *
 * Use this message as such:
 *
 * TVThreadUsage	usage;
 *
 * tvGetThreadUsage(tvGetThreadID(), &usage);
 * tvLogData(UL_ENTRY_THREAD_USAGE, sizeof(usage)/4, &usage);
 *
 * The print formating of the usage data is defined in tvlog.ul.
 */
#define UL_ENTRY_THREAD_USAGE   8183

/*
 * This message is used for logging buffer flushing event for circular buffering.
 */
#define UL_ENTRY_FLUSH_BUFFER   8184

/*
 * This message is used for logging event missed.
 */
#define UL_ENTRY_EVENT_MISSED   8185

/*
 * Logging of serial numbers.  They should be in order.
 */
#define UL_ENTRY_SERIAL_NUMBER  8186

/*
 * Events coming from the appmanager describing changes to logging on the 
 * settop.
 */

/*
 * Logging of when a log range gets set
 */
#define UL_LOG_SET_MASK       	8187

/*
 * Logging of when a log range gets set
 */
#define UL_LOG_CLEAR_MASK     	8188

/*
 * Logging of when the log gets turned on or off
 */
#define UL_LOG_SET_RATE 	8189

/*
 * Logging of when the log gets turned on or off
 */
#define UL_LOG_CONTROL  	8190

/*
 * Logging of the HCT id and the current time so that the daemon
 * can cross reference the I.P. address to its local cache. It also
 * includes the current time of day so that the RPSS values in the
 * log messages sent up to the daemon can be adjusted to the time
 * the set-top has.
 */
#define UL_LOG_HCTID_TOD      	8191

/*
 * That's all folks. Do not pick a number >= 8192
 */