int display_qvariant(char *buf) { char *orig_buf=buf; uint32_t type = *((uint32_t*)buf); type=ntohl(type); buf+=4; char null=*buf; buf++; if(null) { //Nothing to do } switch(type) { case 1: buf+=display_bool(buf); break; case 2: case 3: buf+=display_int(buf, type); break; case 7: //UTF16 byte buf+=display_short(buf); break; case 8: buf+=display_map(buf); break; case 9: buf+=display_list(buf); break; case 10: buf+=display_string(buf); break; case 11: buf+=display_stringlist(buf); break; case 12: buf+=display_bytearray(buf); break; case 15: buf+=display_time(buf); break; case 16: buf+=display_date(buf); break; case 127: //User type ! buf+=display_usertype(buf); break; case 133: buf+=display_short(buf); break; default: printf("Unknown QVariant type: %d\n", type); exit(-1); break; }; return buf-orig_buf; }
void UserProc::display() { dprintf( D_ALWAYS, "User Process %d.%d {\n", cluster, proc ); dprintf( D_ALWAYS, " cmd = %s\n", cmd ); MyString args_string; args.GetArgsStringForDisplay(&args_string); dprintf( D_ALWAYS, " args = %s\n", args_string.Value() ); MyString env_string; env_obj.getDelimitedStringForDisplay(&env_string); dprintf( D_ALWAYS, " env = %s\n", env_string.Value() ); dprintf( D_ALWAYS, " local_dir = %s\n", local_dir ); dprintf( D_ALWAYS, " cur_ckpt = %s\n", cur_ckpt ); dprintf( D_ALWAYS, " core_name = %s\n", core_name==NULL?"(either 'core' or 'core.<pid>')":core_name); dprintf( D_ALWAYS, " uid = %d, gid = %d\n", uid, gid ); dprintf( D_ALWAYS, " v_pid = %d\n", v_pid ); if( pid ) { dprintf( D_ALWAYS, " pid = %d\n", pid ); } else { dprintf( D_ALWAYS, " pid = (NOT CURRENTLY EXECUTING)\n" ); } display_bool( D_ALWAYS, " exit_status_valid", exit_status_valid ); if( exit_status_valid ) { dprintf( D_ALWAYS, " exit_status = 0x%x\n", exit_status ); } else { dprintf( D_ALWAYS, " exit_status = (NEVER BEEN EXECUTED)\n" ); } display_bool( D_ALWAYS, " ckpt_wanted", ckpt_wanted ); display_bool( D_ALWAYS, " coredump_limit_exists", coredump_limit_exists ); if( coredump_limit_exists ) { dprintf( D_ALWAYS, " coredump_limit = %d\n", coredump_limit ); } dprintf( D_ALWAYS, " soft_kill_sig = %d\n", soft_kill_sig ); dprintf( D_ALWAYS, " job_class = %s\n", JobClasses.get_name(job_class) ); dprintf( D_ALWAYS, " state = %s\n", ProcStates.get_name(state) ); display_bool( D_ALWAYS, " new_ckpt_created", new_ckpt_created ); display_bool( D_ALWAYS, " ckpt_transferred", ckpt_transferred ); display_bool( D_ALWAYS, " core_created", core_created ); display_bool( D_ALWAYS, " core_transferred", core_transferred ); display_bool( D_ALWAYS, " exit_requested", exit_requested ); dprintf( D_ALWAYS, " image_size = %d blocks\n", image_size ); dprintf( D_ALWAYS, " user_time = %ld\n", (long)user_time ); dprintf( D_ALWAYS, " sys_time = %ld\n", (long)sys_time ); dprintf( D_ALWAYS, " guaranteed_user_time = %ld\n", (long)guaranteed_user_time ); dprintf( D_ALWAYS, " guaranteed_sys_time = %ld\n", (long)guaranteed_sys_time ); dprintf( D_ALWAYS, "}\n" ); }