mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 06:57:51 +00:00
parent
cf904e0a5d
commit
73dad70356
@ -25,6 +25,7 @@ namespace Genode { namespace Trace {
|
|||||||
struct Rpc_reply;
|
struct Rpc_reply;
|
||||||
struct Signal_submit;
|
struct Signal_submit;
|
||||||
struct Signal_received;
|
struct Signal_received;
|
||||||
|
struct Checkpoint;
|
||||||
} }
|
} }
|
||||||
|
|
||||||
|
|
||||||
@ -121,4 +122,33 @@ struct Genode::Trace::Signal_received
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct Genode::Trace::Checkpoint
|
||||||
|
{
|
||||||
|
enum Type : unsigned char {
|
||||||
|
UNDEF = 0x0,
|
||||||
|
START = 0x1,
|
||||||
|
END = 0x2,
|
||||||
|
OBJ_NEW = 0x10,
|
||||||
|
OBJ_DEL = 0x11,
|
||||||
|
OBJ_STATE = 0x12,
|
||||||
|
EXCEPTION = 0xfe,
|
||||||
|
FAILURE = 0xff
|
||||||
|
};
|
||||||
|
|
||||||
|
char const *name;
|
||||||
|
unsigned long const data;
|
||||||
|
Type const type;
|
||||||
|
void *addr;
|
||||||
|
|
||||||
|
Checkpoint(char const *name, unsigned long data, void *addr, Type type=Type::UNDEF)
|
||||||
|
: name(name), data(data), type(type), addr(addr)
|
||||||
|
{
|
||||||
|
Thread::trace(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t generate(Policy_module &policy, char *dst) const {
|
||||||
|
return policy.checkpoint(dst, name, data, addr, type); }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* _INCLUDE__BASE__TRACE__EVENTS_H_ */
|
#endif /* _INCLUDE__BASE__TRACE__EVENTS_H_ */
|
||||||
|
@ -32,6 +32,7 @@ namespace Genode {
|
|||||||
struct Genode::Trace::Policy_module
|
struct Genode::Trace::Policy_module
|
||||||
{
|
{
|
||||||
size_t (*max_event_size) ();
|
size_t (*max_event_size) ();
|
||||||
|
size_t (*checkpoint) (char *, char const *, unsigned long, void *, unsigned char);
|
||||||
size_t (*log_output) (char *, char const *, size_t);
|
size_t (*log_output) (char *, char const *, size_t);
|
||||||
size_t (*rpc_call) (char *, char const *, Msgbuf_base const &);
|
size_t (*rpc_call) (char *, char const *, Msgbuf_base const &);
|
||||||
size_t (*rpc_returned) (char *, char const *, Msgbuf_base const &);
|
size_t (*rpc_returned) (char *, char const *, Msgbuf_base const &);
|
||||||
|
@ -22,6 +22,7 @@ namespace Genode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern "C" size_t max_event_size ();
|
extern "C" size_t max_event_size ();
|
||||||
|
extern "C" size_t checkpoint (char *dst, char const *name, unsigned long, void *, unsigned char);
|
||||||
extern "C" size_t log_output (char *dst, char const *log_message, size_t len);
|
extern "C" size_t log_output (char *dst, char const *log_message, size_t len);
|
||||||
extern "C" size_t rpc_call (char *dst, char const *rpc_name, Genode::Msgbuf_base const &);
|
extern "C" size_t rpc_call (char *dst, char const *rpc_name, Genode::Msgbuf_base const &);
|
||||||
extern "C" size_t rpc_returned (char *dst, char const *rpc_name, Genode::Msgbuf_base const &);
|
extern "C" size_t rpc_returned (char *dst, char const *rpc_name, Genode::Msgbuf_base const &);
|
||||||
|
@ -18,6 +18,12 @@ size_t max_event_size()
|
|||||||
return MAX_EVENT_SIZE;
|
return MAX_EVENT_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
size_t checkpoint(char *dst, char const *, unsigned long, void *, unsigned char)
|
||||||
|
{
|
||||||
|
return div_zero();
|
||||||
|
}
|
||||||
|
|
||||||
size_t log_output(char *dst, char const *log_message, size_t len)
|
size_t log_output(char *dst, char const *log_message, size_t len)
|
||||||
{
|
{
|
||||||
return div_zero();
|
return div_zero();
|
||||||
|
@ -10,6 +10,11 @@ size_t max_event_size()
|
|||||||
return MAX_EVENT_SIZE;
|
return MAX_EVENT_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t checkpoint(char *dst, char const *, unsigned long, void *, unsigned char)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
size_t log_output(char *dst, char const *log_message, size_t len)
|
size_t log_output(char *dst, char const *log_message, size_t len)
|
||||||
{
|
{
|
||||||
len = min(len, MAX_EVENT_SIZE);
|
len = min(len, MAX_EVENT_SIZE);
|
||||||
|
@ -7,6 +7,11 @@ size_t max_event_size()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t checkpoint(char *dst, char const *, unsigned long, void *, unsigned char)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
size_t log_output(char *dst, char const *log_message, size_t len)
|
size_t log_output(char *dst, char const *log_message, size_t len)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -10,6 +10,11 @@ size_t max_event_size()
|
|||||||
return MAX_EVENT_SIZE;
|
return MAX_EVENT_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t checkpoint(char *, char const *, unsigned long, void *, unsigned char)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
size_t log_output(char *dst, char const *log_message, size_t len)
|
size_t log_output(char *dst, char const *log_message, size_t len)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -19,6 +19,7 @@ extern "C" {
|
|||||||
Genode::Trace::Policy_module policy_jump_table =
|
Genode::Trace::Policy_module policy_jump_table =
|
||||||
{
|
{
|
||||||
max_event_size,
|
max_event_size,
|
||||||
|
checkpoint,
|
||||||
log_output,
|
log_output,
|
||||||
rpc_call,
|
rpc_call,
|
||||||
rpc_returned,
|
rpc_returned,
|
||||||
|
Loading…
Reference in New Issue
Block a user