Changeset abf3564 in mainline for uspace/app/trace/ipcp.c
- Timestamp:
- 2008-09-18T22:19:42Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f7176b1
- Parents:
- 073c9e6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/trace/ipcp.c
r073c9e6 rabf3564 47 47 int phone_hash; 48 48 ipc_call_t question; 49 oper_t *oper; 49 50 50 51 int call_hash; … … 146 147 oper_t *oper; 147 148 149 val_type_t arg_def[OPER_MAX_ARGS] = { 150 V_INTEGER, 151 V_INTEGER, 152 V_INTEGER, 153 V_INTEGER, 154 V_INTEGER 155 }; 156 148 157 /* 149 158 * Create a pseudo-protocol 'unknown' that has no known methods. … … 159 168 desc = ipc_methods; 160 169 while (desc->number != 0) { 161 oper = oper_new(desc->name); 170 oper = oper_new(desc->name, OPER_MAX_ARGS, arg_def, V_INTEGER, 171 OPER_MAX_ARGS, arg_def); 162 172 proto_add_oper(proto_system, desc->number, oper); 163 173 … … 180 190 unsigned long key[1]; 181 191 oper_t *oper; 192 ipcarg_t *args; 193 int i; 182 194 183 195 if (have_conn[phone]) proto = connections[phone].proto; 184 196 else proto = NULL; 197 198 args = call->args; 185 199 186 200 if ((display_mask & DM_IPC) != 0) { … … 188 202 phone, (proto ? proto->name : "n/a")); 189 203 ipc_m_print(proto, IPC_GET_METHOD(*call)); 190 printf(" args: (%u, %u, %u, %u, %u)\n", 191 IPC_GET_ARG1(*call), 192 IPC_GET_ARG2(*call), 193 IPC_GET_ARG3(*call), 194 IPC_GET_ARG4(*call), 195 IPC_GET_ARG5(*call) 196 ); 204 printf(" args: (%u, %u, %u, %u, %u)\n", args[1], args[2], 205 args[3], args[4], args[5]); 197 206 } 198 207 … … 211 220 phone, (oper ? oper->name : "unknown")); 212 221 213 printf("(%u, %u, %u, %u, %u)\n", 214 IPC_GET_ARG1(*call), 215 IPC_GET_ARG2(*call), 216 IPC_GET_ARG3(*call), 217 IPC_GET_ARG4(*call), 218 IPC_GET_ARG5(*call) 219 ); 220 } 222 putchar('('); 223 for (i = 1; i <= oper->argc; ++i) { 224 if (i > 1) printf(", "); 225 val_print(args[i], oper->arg_type[i - 1]); 226 } 227 putchar(')'); 228 229 if (oper->rv_type == V_VOID && oper->respc == 0) { 230 /* 231 * No response data (typically the task will 232 * not be interested in the response). 233 * We will not display response. 234 */ 235 putchar('.'); 236 } 237 238 putchar('\n'); 239 } 240 } else { 241 oper = NULL; 221 242 } 222 243 … … 227 248 pcall->question = *call; 228 249 pcall->call_hash = hash; 250 pcall->oper = oper; 229 251 230 252 key[0] = hash; … … 243 265 int cphone; 244 266 267 ipcarg_t *resp; 268 oper_t *oper; 269 int i; 270 245 271 // printf("parse_answer\n"); 246 272 … … 248 274 method = IPC_GET_METHOD(pcall->question); 249 275 retval = IPC_GET_RETVAL(*answer); 276 277 resp = answer->args; 250 278 251 279 if ((display_mask & DM_IPC) != 0) { … … 257 285 258 286 if ((display_mask & DM_USER) != 0) { 259 printf("-> %d\n", retval); 287 oper = pcall->oper; 288 289 if (oper->rv_type != V_VOID || oper->respc > 0) { 290 printf("->"); 291 292 if (oper->rv_type != V_VOID) { 293 putchar(' '); 294 val_print(retval, oper->rv_type); 295 } 296 297 if (oper->respc > 0) { 298 putchar(' '); 299 putchar('('); 300 for (i = 1; i <= oper->respc; ++i) { 301 if (i > 1) printf(", "); 302 val_print(resp[i], oper->resp_type[i - 1]); 303 } 304 putchar(')'); 305 } 306 307 putchar('\n'); 308 } 260 309 } 261 310
Note:
See TracChangeset
for help on using the changeset viewer.