예제 #1
0
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();
}
예제 #2
0
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();
}
예제 #3
0
파일: zune-test.c 프로젝트: nakulj/cs-402
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() );
}
예제 #4
0
파일: ErrorOutput.hpp 프로젝트: obmun/moab
 //!\brief Output the specified string
 void print(const std::string& str) { print_real(str); }
예제 #5
0
void DebugOutput::tprint_real( const char* fmt, va_list args1, va_list args2 )
{
  tprint();
  print_real( fmt, args1, args2 );
}
예제 #6
0
void DebugOutput::tprint_real( const std::string& str )
{
  tprint();
  print_real( str );
}
예제 #7
0
void DebugOutput::tprint_real( const char* buffer )
{
  tprint();
  print_real( buffer );
}