void DebugOutput::list_ints_real( const char* pfx, const Range& range ) { if (range.empty()) { print_real("<empty>\n"); return; } if (pfx) { lineBuffer.insert( lineBuffer.end(), pfx, pfx+strlen(pfx) ); lineBuffer.push_back(' '); } char numbuf[48]; // unsigned 64 bit integer can't have more than 20 decimal digits Range::const_pair_iterator i; for (i = range.const_pair_begin(); i != range.const_pair_end(); ++i) { if (i->first == i->second) sprintf(numbuf, " %lu,", (unsigned long)(i->first)); else print_range(numbuf, (unsigned long)(i->first), (unsigned long)(i->second)); lineBuffer.insert( lineBuffer.end(), numbuf, numbuf+strlen(numbuf) ); } lineBuffer.push_back('\n'); process_line_buffer(); }
void DebugOutput::list_range_real( const char* pfx, const Range& range ) { if (pfx) { lineBuffer.insert( lineBuffer.end(), pfx, pfx+strlen(pfx) ); lineBuffer.push_back(' '); } if (range.empty()) { print_real("<empty>\n"); return; } char numbuf[48]; // unsigned 64 bit integer can't have more than 20 decimal digits Range::const_pair_iterator i; EntityType type = MBMAXTYPE; for (i = range.const_pair_begin(); i != range.const_pair_end(); ++i) { if (TYPE_FROM_HANDLE(i->first) != type) { type = TYPE_FROM_HANDLE(i->first); const char* name = CN::EntityTypeName(type); lineBuffer.insert( lineBuffer.end(), name, name+strlen(name) ); } if (i->first == i->second) sprintf(numbuf, " %lu,", (unsigned long)(ID_FROM_HANDLE(i->first))); else print_range(numbuf, ID_FROM_HANDLE(i->first), ID_FROM_HANDLE(i->second) ); lineBuffer.insert( lineBuffer.end(), numbuf, numbuf+strlen(numbuf) ); } lineBuffer.push_back('\n'); process_line_buffer(); }
void zune_test (void) { char name[16] = "thread 1 name"; int priority = 10; if (thread_mlfqs) { printf("mlfqs true\n"); } else { printf("mlfqs false\n"); } printf("Initialized. Calling get ready threads: %d \n", get_ready_threads_count()); thread_create(name, priority, zune_thread_func, NULL); printf("1 Thread Created. Calling get ready threads: %d \n", get_ready_threads_count()); printf("Initialized Load Avg: "); print_real(thread_get_load_avg()); thread_calc_load_avg(); printf("\nRecalculated Load Avg: "); print_real(thread_get_load_avg()); printf("\nInitialized CPU Load: "); print_real( thread_get_recent_cpu() ); thread_all_calc_recent_cpu(); printf("\nCalculated CPU Load BEFORE set nice: "); print_real( thread_get_recent_cpu() ); thread_set_nice(2); thread_all_calc_recent_cpu(); printf("\nCalculated CPU Load AFTER set nice 2: "); print_real( thread_get_recent_cpu() ); //thread_set_nice(2); thread_all_calc_recent_cpu(); printf("\nCalculated CPU Load AFTER set nice again: "); print_real( thread_get_recent_cpu() ); }
//!\brief Output the specified string void print(const std::string& str) { print_real(str); }
void DebugOutput::tprint_real( const char* fmt, va_list args1, va_list args2 ) { tprint(); print_real( fmt, args1, args2 ); }
void DebugOutput::tprint_real( const std::string& str ) { tprint(); print_real( str ); }
void DebugOutput::tprint_real( const char* buffer ) { tprint(); print_real( buffer ); }