mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
parent
cf904e0a5d
commit
73dad70356
@ -25,6 +25,7 @@ namespace Genode { namespace Trace {
|
||||
struct Rpc_reply;
|
||||
struct Signal_submit;
|
||||
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_ */
|
||||
|
@ -31,14 +31,15 @@ namespace Genode {
|
||||
*/
|
||||
struct Genode::Trace::Policy_module
|
||||
{
|
||||
size_t (*max_event_size) ();
|
||||
size_t (*log_output) (char *, char const *, size_t);
|
||||
size_t (*rpc_call) (char *, char const *, Msgbuf_base const &);
|
||||
size_t (*rpc_returned) (char *, char const *, Msgbuf_base const &);
|
||||
size_t (*rpc_dispatch) (char *, char const *);
|
||||
size_t (*rpc_reply) (char *, char const *);
|
||||
size_t (*signal_submit) (char *, unsigned const);
|
||||
size_t (*signal_received) (char *, Signal_context const &, unsigned const);
|
||||
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 (*rpc_call) (char *, char const *, Msgbuf_base const &);
|
||||
size_t (*rpc_returned) (char *, char const *, Msgbuf_base const &);
|
||||
size_t (*rpc_dispatch) (char *, char const *);
|
||||
size_t (*rpc_reply) (char *, char const *);
|
||||
size_t (*signal_submit) (char *, unsigned const);
|
||||
size_t (*signal_received) (char *, Signal_context const &, unsigned const);
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__BASE__TRACE__POLICY_H_ */
|
||||
|
@ -21,11 +21,12 @@ namespace Genode {
|
||||
struct Signal_context;
|
||||
}
|
||||
|
||||
extern "C" size_t max_event_size ();
|
||||
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_returned (char *dst, char const *rpc_name, Genode::Msgbuf_base const &);
|
||||
extern "C" size_t rpc_dispatch (char *dst, char const *rpc_name);
|
||||
extern "C" size_t rpc_reply (char *dst, char const *rpc_name);
|
||||
extern "C" size_t signal_submit (char *dst, unsigned const);
|
||||
extern "C" size_t signal_receive (char *dst, Genode::Signal_context const &, unsigned);
|
||||
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 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_dispatch (char *dst, char const *rpc_name);
|
||||
extern "C" size_t rpc_reply (char *dst, char const *rpc_name);
|
||||
extern "C" size_t signal_submit (char *dst, unsigned const);
|
||||
extern "C" size_t signal_receive (char *dst, Genode::Signal_context const &, unsigned);
|
||||
|
@ -18,6 +18,12 @@ size_t 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)
|
||||
{
|
||||
return div_zero();
|
||||
|
@ -10,6 +10,11 @@ size_t 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)
|
||||
{
|
||||
len = min(len, MAX_EVENT_SIZE);
|
||||
|
@ -7,6 +7,11 @@ size_t max_event_size()
|
||||
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)
|
||||
{
|
||||
return 0;
|
||||
|
@ -10,6 +10,11 @@ size_t 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)
|
||||
{
|
||||
return 0;
|
||||
|
@ -19,6 +19,7 @@ extern "C" {
|
||||
Genode::Trace::Policy_module policy_jump_table =
|
||||
{
|
||||
max_event_size,
|
||||
checkpoint,
|
||||
log_output,
|
||||
rpc_call,
|
||||
rpc_returned,
|
||||
|
Loading…
Reference in New Issue
Block a user