6 static const struct flags rss_flags
[] = {
12 FLAG(RSS_SYS_BASIC_CALLS
),
13 FLAG(RSS_VM_BASIC_CALLS
),
18 put_struct_rs_start(struct trace_proc
* proc
, const char * name
,
23 if (!put_open_struct(proc
, name
, 0, addr
, &buf
, sizeof(buf
)))
27 put_flags(proc
, "rss_flags", rss_flags
, COUNT(rss_flags
),
28 "0x%x", buf
.rss_flags
);
29 put_buf(proc
, "rss_cmd", 0, (vir_bytes
)buf
.rss_cmd
, buf
.rss_cmdlen
);
30 put_buf(proc
, "rss_progname", 0, (vir_bytes
)buf
.rss_progname
,
32 put_buf(proc
, "rss_label", 0, (vir_bytes
)buf
.rss_label
.l_addr
,
34 if (verbose
> 0 || buf
.rss_major
!= 0)
35 put_value(proc
, "rss_major", "%d", buf
.rss_major
);
36 if (verbose
> 0 || buf
.devman_id
!= 0)
37 put_value(proc
, "devman_id", "%d", buf
.devman_id
);
38 put_value(proc
, "rss_uid", "%u", buf
.rss_uid
);
40 put_endpoint(proc
, "rss_sigmgr", buf
.rss_sigmgr
);
41 put_endpoint(proc
, "rss_scheduler", buf
.rss_sigmgr
);
44 put_value(proc
, "rss_priority", "%d", buf
.rss_priority
);
45 put_value(proc
, "rss_quantum", "%d", buf
.rss_quantum
);
48 put_value(proc
, "rss_period", "%ld", buf
.rss_period
);
49 put_buf(proc
, "rss_script", 0, (vir_bytes
)buf
.rss_script
,
53 put_close_struct(proc
, FALSE
/*all*/); /* TODO: the remaining fields */
56 /* This function is shared between rs_up and rs_edit. */
58 rs_up_out(struct trace_proc
* proc
, const message
* m_out
)
61 put_struct_rs_start(proc
, "addr", (vir_bytes
)m_out
->m_rs_req
.addr
);
67 * This function is shared between rs_down, rs_refresh, rs_restart, and
71 rs_label_out(struct trace_proc
* proc
, const message
* m_out
)
75 * We are not using PF_STRING here, because unlike in most places
76 * (including rs_lookup), the string length does not include the
77 * terminating NULL character.
79 put_buf(proc
, "label", 0, (vir_bytes
)m_out
->m_rs_req
.addr
,
86 rs_update_out(struct trace_proc
* proc
, const message
* m_out
)
90 * FIXME: this is a value from the wrong message union, and that is
91 * actually a minix bug.
93 put_struct_rs_start(proc
, "addr", (vir_bytes
)m_out
->m_rs_req
.addr
);
95 /* TODO: interpret these fields */
96 put_value(proc
, "state", "%d", m_out
->m_rs_update
.state
);
97 put_value(proc
, "maxtime", "%d", m_out
->m_rs_update
.prepare_maxtime
);
103 rs_lookup_out(struct trace_proc
* proc
, const message
* m_out
)
106 put_buf(proc
, "label", PF_STRING
, (vir_bytes
)m_out
->m_rs_req
.name
,
107 m_out
->m_rs_req
.name_len
);
113 rs_lookup_in(struct trace_proc
* proc
, const message
* __unused m_out
,
114 const message
* m_in
, int failed
)
118 put_endpoint(proc
, NULL
, m_in
->m_rs_req
.endpoint
);
123 #define RS_CALL(c) [((RS_ ## c) - RS_RQ_BASE)]
125 static const struct call_handler rs_map
[] = {
126 RS_CALL(UP
) = HANDLER("rs_up", rs_up_out
, default_in
),
127 RS_CALL(DOWN
) = HANDLER("rs_down", rs_label_out
, default_in
),
128 RS_CALL(REFRESH
) = HANDLER("rs_refresh", rs_label_out
, default_in
),
129 RS_CALL(RESTART
) = HANDLER("rs_restart", rs_label_out
, default_in
),
130 RS_CALL(SHUTDOWN
) = HANDLER("rs_shutdown", default_out
, default_in
),
131 RS_CALL(CLONE
) = HANDLER("rs_clone", rs_label_out
, default_in
),
132 RS_CALL(UPDATE
) = HANDLER("rs_update", rs_update_out
, default_in
),
133 RS_CALL(EDIT
) = HANDLER("rs_edit", rs_up_out
, default_in
),
134 RS_CALL(LOOKUP
) = HANDLER("rs_lookup", rs_lookup_out
, rs_lookup_in
),
137 const struct calls rs_calls
= {
141 .count
= COUNT(rs_map
)