[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/icecream/icecream
From:       Stephan Kulow <coolo () kde ! org>
Date:       2006-01-15 11:03:31
Message-ID: 1137323011.742099.13590.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 498289 by coolo:

some more debug profiling


 M  +2 -1      daemon/serve.cpp  
 M  +7 -0      services/logging.cpp  
 M  +1 -0      services/logging.h  
 M  +18 -11    services/scheduler.cpp  


--- trunk/kdenonbeta/icecream/icecream/daemon/serve.cpp #498288:498289
@@ -98,6 +98,7 @@
         return pid;
     }
 
+    reset_debug();
     close( socket[0] );
     out_fd = socket[1];
 
@@ -116,7 +117,7 @@
 	    log_info() << "should use " << job->environmentVersion() << "(" << \
                job->targetPlatform() << ") " << job->jobID() << endl;
             string dirname = basedir + "/target=" + job->targetPlatform() + "/" + \
                job->environmentVersion();
             if ( ::access( string( dirname + "/usr/bin/gcc" ).c_str(), X_OK ) ) {
-                log_error() << "I don't have that environment\n";
+                log_error() << "I don't have environment " << \
job->environmentVersion() << "(" << job->targetPlatform() << ") " << job->jobID() << \
                endl;
                 throw myexception( EXIT_DISTCC_FAILED ); // the scheduler didn't \
listen to us!  }
 
--- trunk/kdenonbeta/icecream/icecream/services/logging.cpp #498288:498289
@@ -32,10 +32,12 @@
 ostream *logfile_error = 0;
 ofstream logfile_null( "/dev/null" );
 ofstream logfile_file;
+static string logfile_filename;
 
 void setup_debug(int level, const string &filename)
 {
     debug_level = level;
+    logfile_filename = filename;
 
     ostream *output = 0;
     if ( filename.length() ) {
@@ -65,6 +67,11 @@
         logfile_error = &logfile_null;
 }
 
+void reset_debug() 
+{
+	setup_debug(debug_level, logfile_filename);
+}
+
 #ifdef HAVE_BACKTRACE
 #include <execinfo.h>
 #endif
--- trunk/kdenonbeta/icecream/icecream/services/logging.h #498288:498289
@@ -33,6 +33,7 @@
 extern std::ostream *logfile_trace;
 
 void setup_debug(int level, const std::string &logfile = "");
+void reset_debug();
 
 inline std::ostream & output_date( std::ostream &os )
 {
--- trunk/kdenonbeta/icecream/icecream/services/scheduler.cpp #498288:498289
@@ -943,11 +943,15 @@
     }
   else
     {
-#if DEBUG_SCHEDULER > 0
-      trace() << "put " << job->id << " in joblist of " << cs->nodename << endl;
+#if DEBUG_SCHEDULER >= 0
+      trace() << "put " << job->id << " in joblist of " << cs->nodename;
+      if (!gotit) 
+	trace() << " (will install now)";
+      trace() << endl;
 #endif
       cs->joblist.push_back( job );
-      if ( !gotit ) { // if we made the environment transfer, don't rely on the list
+      if ( !gotit ) // if we made the environment transfer, don't rely on the list
+      {
 	cs->compiler_versions.clear();
         cs->busy_installing = time(0);
       }
@@ -1025,7 +1029,7 @@
   cs->compiler_versions = m->envs;
   cs->busy_installing = 0;
 
-  trace() << cs->nodename << "(" << cs->host_platform << "): [";
+  trace() << "RELOGIN " << cs->nodename << "(" << cs->host_platform << "): [";
   for (Environments::const_iterator it = m->envs.begin();
        it != m->envs.end(); ++it)
     trace() << it->second << "(" << it->first << "), ";
@@ -1060,18 +1064,21 @@
     trace() << "handle_job_begin: no valid job id " << m->job_id << endl;
     return false;
   }
-#if DEBUG_SCHEDULER > 0
-  trace() << "BEGIN: " << m->job_id << endl;
-#endif
-  if (jobs[m->job_id]->server != c) {
+  Job *job = jobs[m->job_id];
+  if (job->server != c) {
     trace() << "that job isn't handled by " << c->name << endl;
     return false;
   }
-  jobs[m->job_id]->state = Job::COMPILING;
-  jobs[m->job_id]->starttime = m->stime;
-  jobs[m->job_id]->start_on_scheduler = time(0);
+  job->state = Job::COMPILING;
+  job->starttime = m->stime;
+  job->start_on_scheduler = time(0);
   CS *cs = dynamic_cast<CS*>( c );
   notify_monitors (MonJobBeginMsg (m->job_id, m->stime, cs->hostid));
+#if DEBUG_SCHEDULER > 0
+  trace() << "BEGIN: " << m->job_id << " client=" << j->submitter->nodename << "(" \
<< job->target_platform  +          << ")" << " server=" << job->server->nodename << \
"(" << job->server->host_platform << ")" << endl; +#endif
+
   return true;
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic