3 * Copyright 2008 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef INCLUDED_GCELL_GC_LOGGING_H
22 #define INCLUDED_GCELL_GC_LOGGING_H
24 #include <gcell/gc_types.h>
29 typedef struct gc_log {
30 gc_eaddr_t base; // gc_log_entry_t * (16 byte aligned)
31 uint32_t nentries; // number of entries (power-of-2)
34 typedef struct gc_log_entry {
35 uint32_t seqno; // monotonic sequence number
36 uint32_t timestamp; // decrementer value (wraps every 53s on PS3)
37 uint16_t subsystem; // 0 to 255 reserved for system, user gets 256 and up
40 } _AL16 gc_log_entry_t;
42 #define GCL_SS_SYS 0 // lowest system reserved subsystem
43 #define GCL_SS_USER 256 // lowest user reserved subsystem
47 * The resulting log files can be displayed using using:
49 * $ od -t x4 -w32 spu_log.00 | less
56 * System fills in seqno and timestamp. User is responsible for the rest.
59 void _gc_log_write(gc_log_entry_t entry);
61 #ifdef ENABLE_GC_LOGGING
62 #define gc_log_write(entry) _gc_log_write(entry)
64 #define gc_log_write(entry) do { } while (0)
68 gc_log_write0(int subsystem, int event)
71 e.subsystem = subsystem;
82 gc_log_write1(int subsystem, int event,
86 e.subsystem = subsystem;
97 gc_log_write2(int subsystem, int event,
98 uint32_t info0, uint32_t info1)
101 e.subsystem = subsystem;
112 gc_log_write3(int subsystem, int event,
113 uint32_t info0, uint32_t info1, uint32_t info2)
116 e.subsystem = subsystem;
127 gc_log_write4(int subsystem, int event,
128 uint32_t info0, uint32_t info1, uint32_t info2, uint32_t info3)
131 e.subsystem = subsystem;
142 gc_log_write5(int subsystem, int event,
143 uint32_t info0, uint32_t info1, uint32_t info2, uint32_t info3, uint32_t info4)
146 e.subsystem = subsystem;
157 * One time initialization called by system runtime
160 _gc_log_init(gc_log_t log_info);
166 #endif /* INCLUDED_GCELL_GC_LOGGING_H */