source: UsbWattMeter/trunk/asp_dcre/arch/logtrace/trace_config.h@ 164

Last change on this file since 164 was 164, checked in by coas-nagasima, 6 years ago

TOPPERS/ECNLサンプルアプリ「USB充電器電力計」を追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-chdr
File size: 5.6 KB
Line 
1/*
2 * TOPPERS Software
3 * Toyohashi Open Platform for Embedded Real-Time Systems
4 *
5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
6 * Toyohashi Univ. of Technology, JAPAN
7 * Copyright (C) 2004-2012 by Embedded and Real-Time Systems Laboratory
8 * Graduate School of Information Science, Nagoya Univ., JAPAN
9 *
10 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
11 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
12 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
13 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
14 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
15 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
16 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
17 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
18ƒƒ“ƒgi—˜—p
19 * ŽÒƒ}ƒjƒ…
20ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
21 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
22 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
23 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
24 * ‚ƁD
25 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
26ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
27ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
28 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
29 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
30 * •ñ‚·‚邱‚ƁD
31 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
32 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
33 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
34 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
35 * –Ɛӂ·‚邱‚ƁD
36 *
37 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
38 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
39 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
40 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
41 * ‚̐ӔC‚𕉂í‚È‚¢D
42 *
43 * $Id: trace_config.h 164 2016-03-07 11:33:50Z coas-nagasima $
44 */
45
46/*
47 * ƒgƒŒ[ƒXƒƒO‚ÉŠÖ‚·‚éÝ’è
48 *
49 * ‚±‚̃Cƒ“ƒNƒ‹[ƒhƒtƒ@ƒCƒ‹‚́Ctarget_config.h‚¨‚æ‚Ñtarget_syssvc.h‚Ì
50 * ‚Ý‚©‚çƒCƒ“ƒNƒ‹[ƒh‚³‚ê‚éD‚Ü‚½CƒgƒŒ[ƒXƒƒO‹@”\‚̏‰Šú‰»‚â‹L˜^‚ÌŠJ
51 * Žn^’âŽ~CƒgƒŒ[ƒXƒƒO‚̃_ƒ“ƒv‚ðs‚¤ƒvƒƒOƒ‰ƒ€‚©‚çƒCƒ“ƒNƒ‹[ƒh‚·‚é
52 * ‚±‚Æ‚ð‘z’肵‚Ä‚¢‚éD
53 */
54
55#ifndef TOPPERS_TRACE_CONFIG_H
56#define TOPPERS_TRACE_CONFIG_H
57
58/*
59 * ƒgƒŒ[ƒXƒƒOƒoƒbƒtƒ@‚̃TƒCƒY
60 */
61#ifndef TCNT_TRACE_BUFFER
62#define TCNT_TRACE_BUFFER 1024
63#endif /* TCNT_TRACE_BUFFER */
64
65/*
66 * ƒgƒŒ[ƒXŽž‚̎擾•û–@
67 */
68#ifndef TRACE_GET_TIM
69#define TRACE_GET_TIM() (current_time)
70#endif /* TRACE_GET_TIM */
71
72#ifndef TOPPERS_MACRO_ONLY
73
74/*
75 * ƒgƒŒ[ƒXƒƒO‚̃f[ƒ^\‘¢
76 *
77 * ƒVƒXƒeƒ€ƒƒO‹@”\‚̃ƒOî•ñ‚̃f[ƒ^\‘¢‚Æ“¯‚¶‚à‚Ì‚ð—p‚¢‚éD
78 */
79#include <t_syslog.h>
80typedef SYSLOG TRACE;
81
82/*
83 * ƒgƒŒ[ƒXƒƒOƒoƒbƒtƒ@‚Æ‚»‚ê‚ɃAƒNƒZƒX‚·‚邽‚߂̃|ƒCƒ“ƒ^
84 */
85extern TRACE trace_buffer[]; /* ƒgƒŒ[ƒXƒƒOƒoƒbƒtƒ@ */
86extern uint_t trace_count; /* ƒgƒŒ[ƒXƒƒOƒoƒbƒtƒ@’†‚̃ƒO‚̐” */
87extern uint_t trace_head; /* æ“ª‚̃gƒŒ[ƒXƒƒO‚ÌŠi”[ˆÊ’u */
88extern uint_t trace_tail; /* ŽŸ‚̃gƒŒ[ƒXƒƒO‚ÌŠi”[ˆÊ’u */
89extern uint_t trace_lost; /* Ž¸‚í‚ꂽƒgƒŒ[ƒX‚̐” */
90
91#endif /* TOPPERS_MACRO_ONLY */
92
93/*
94 * ƒgƒŒ[ƒXƒ‚[ƒh‚Ì’è‹`
95 */
96#define TRACE_STOP UINT_C(0x00) /* ƒgƒŒ[ƒX’âŽ~ */
97#define TRACE_RINGBUF UINT_C(0x01) /* ƒŠƒ“ƒOƒoƒbƒtƒ@ƒ‚[ƒh */
98#define TRACE_AUTOSTOP UINT_C(0x02) /* Ž©“®’âŽ~ƒ‚[ƒh */
99#define TRACE_CLEAR UINT_C(0x04) /* ƒgƒŒ[ƒXƒƒO‚̃NƒŠƒA */
100
101#ifndef TOPPERS_MACRO_ONLY
102
103/*
104 * ƒgƒŒ[ƒXƒƒO‹@”\‚̏‰Šú‰»
105 *
106 * ƒgƒŒ[ƒXƒƒO‹@”\‚ð‰Šú‰»‚·‚éD‰Šú‰»ƒ‹[ƒ`ƒ“‚Æ‚µ‚Ä“o˜^‚·‚邱‚Æ‚ð‘z
107 * ’肵‚Ä‚¢‚éDˆø”‚É‚æ‚莟‚Ì“®ì‚ðs‚¤D
108 *
109 * TRACE_STOPF‰Šú‰»‚݂̂ŃgƒŒ[ƒX‚ÍŠJŽn‚µ‚È‚¢D
110 * TRACE_RINGBUFFƒŠƒ“ƒOƒoƒbƒtƒ@ƒ‚[ƒh‚ŃgƒŒ[ƒX‚ðŠJŽnD
111 * TRACE_AUTOSTOPFŽ©“®’âŽ~ƒ‚[ƒh‚ŃgƒŒ[ƒX‚ðŠJŽnD
112 */
113extern void trace_initialize(intptr_t exinf);
114
115/*
116 * ƒgƒŒ[ƒXƒƒO‚ÌŠJŽn
117 *
118 * ƒgƒŒ[ƒXƒƒO‚Ì‹L˜^‚ðŠJŽn^’âŽ~‚·‚éDˆø”‚É‚æ‚莟‚Ì“®ì‚ðs‚¤D
119 *
120 * TRACE_STOPFƒgƒŒ[ƒX‚ð’âŽ~D
121 * TRACE_RINGBUFFƒŠƒ“ƒOƒoƒbƒtƒ@ƒ‚[ƒh‚ŃgƒŒ[ƒX‚ðŠJŽnD
122 * TRACE_AUTOSTOPFŽ©“®’âŽ~ƒ‚[ƒh‚ŃgƒŒ[ƒX‚ðŠJŽnD
123 * TRACE_CLEARFƒgƒŒ[ƒXƒƒO‚ðƒNƒŠƒAD
124 */
125extern ER trace_sta_log(MODE mode);
126
127/*
128 * ƒgƒŒ[ƒXƒƒO‚̏‘ž‚Ý
129 */
130extern ER trace_wri_log(TRACE *p_trace);
131
132/*
133 * ƒgƒŒ[ƒXƒƒO‚̓Ǐo‚µ
134 */
135extern ER trace_rea_log(TRACE *p_trace);
136
137/*
138 * ƒgƒŒ[ƒXƒƒO‚̃_ƒ“ƒvitrace_dump.cj
139 *
140 * ƒgƒŒ[ƒXƒƒO‚ðƒ_ƒ“ƒv‚·‚éDI—¹ˆ—ƒ‹[ƒ`ƒ“‚Æ‚µ‚Ä“o˜^‚·‚邱‚Æ‚à‘z’è
141 * ‚µ‚Ä‚¢‚éDˆø”‚Æ‚µ‚āCƒ_ƒ“ƒvæ‚ƂȂ镶Žšo—͊֐”‚ւ̃|ƒCƒ“ƒ^‚ð“n‚·D
142 * ƒ^[ƒQƒbƒgˆË‘¶‚̒჌ƒxƒ‹•¶Žšo—Í‚ð—˜—p‚·‚éê‡‚ɂ́Ctarget_putc‚ð“n
143 * ‚·D
144 */
145extern void trace_dump(intptr_t exinf);
146
147/*
148 * ƒgƒŒ[ƒXƒƒO‚ðo—Í‚·‚邽‚߂̃‰ƒCƒuƒ‰ƒŠŠÖ”
149 */
150extern void trace_write_0(uint_t type);
151extern void trace_write_1(uint_t type, intptr_t arg1);
152extern void trace_write_2(uint_t type, intptr_t arg1, intptr_t arg2);
153extern void trace_write_3(uint_t type, intptr_t arg1, intptr_t arg2,
154 intptr_t arg3);
155
156/*
157 * ƒgƒŒ[ƒXƒƒO‚ðo—Í‚·‚邽‚߂̃}ƒNƒ
158 */
159
160#define trace_0(type) \
161 trace_write_0(type)
162
163#define trace_1(type, arg1) \
164 trace_write_1(type, (intptr_t)(arg1))
165
166#define trace_2(type, arg1, arg2) \
167 trace_write_2(type, (intptr_t)(arg1), (intptr_t)(arg2))
168
169#define trace_3(type, arg1, arg2, arg3) \
170 trace_write_3(type, (intptr_t)(arg1), (intptr_t)(arg2), \
171 (intptr_t)(arg3))
172
173#endif /* TOPPERS_MACRO_ONLY */
174
175/*
176 * ƒgƒŒ[ƒXƒƒO•û–@‚̐ݒè
177 */
178#define LOG_TSKSTAT(p_tcb) trace_2(LOG_TYPE_TSKSTAT, p_tcb, p_tcb->tstat)
179
180#define LOG_DSP_LEAVE(p_tcb) trace_1(LOG_TYPE_DSP|LOG_LEAVE, p_tcb)
181
182#define LOG_SYSLOG_WRI_LOG_ENTER(prio, p_syslog) \
183 trace_wri_log((TRACE *) p_syslog)
184
185#endif /* TOPPERS_TRACE_CONFIG_H */
Note: See TracBrowser for help on using the repository browser.