From 75b01cfc0adcf6a010316b69475d4386c049474d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 23 Sep 2020 16:14:09 +0200 Subject: [PATCH 1/2] [libcalamares] Some debugging output for job progress, so you can double-check that the settings are being picked up --- src/libcalamares/JobQueue.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libcalamares/JobQueue.cpp b/src/libcalamares/JobQueue.cpp index 2b17b64bd..d5b588a5d 100644 --- a/src/libcalamares/JobQueue.cpp +++ b/src/libcalamares/JobQueue.cpp @@ -67,6 +67,13 @@ public: { m_overallQueueWeight = 1.0; } + + cDebug() << "There are" << m_runningJobs->count() << "jobs, total weight" << m_overallQueueWeight; + int c = 1; + for( const auto& j : *m_runningJobs ) + { + cDebug() << Logger::SubEntry << "Job" << c << j.job->prettyName() << "wt" << j.weight << " c.wt" << j.cumulative; + } } void enqueue( int moduleWeight, const JobList& jobs ) From ace632398719d62a3240b83b10a474bef913fddc Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 28 Sep 2020 11:28:47 +0200 Subject: [PATCH 2/2] [libcalamares] Be even more chatty in job progress This is for debugging-job-progress reports. --- src/libcalamares/JobQueue.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/libcalamares/JobQueue.cpp b/src/libcalamares/JobQueue.cpp index d5b588a5d..15c085b7e 100644 --- a/src/libcalamares/JobQueue.cpp +++ b/src/libcalamares/JobQueue.cpp @@ -69,10 +69,12 @@ public: } cDebug() << "There are" << m_runningJobs->count() << "jobs, total weight" << m_overallQueueWeight; - int c = 1; - for( const auto& j : *m_runningJobs ) + int c = 0; + for ( const auto& j : *m_runningJobs ) { - cDebug() << Logger::SubEntry << "Job" << c << j.job->prettyName() << "wt" << j.weight << " c.wt" << j.cumulative; + cDebug() << Logger::SubEntry << "Job" << ( c + 1 ) << j.job->prettyName() << "+wt" << j.weight << "tot.wt" + << ( j.cumulative + j.weight ); + c++; } } @@ -116,9 +118,9 @@ public: } else { - emitProgress( 0.0 ); // 0% for *this job* cDebug() << "Starting" << ( failureEncountered ? "EMERGENCY JOB" : "job" ) << jobitem.job->prettyName() << '(' << ( m_jobIndex + 1 ) << '/' << m_runningJobs->count() << ')'; + emitProgress( 0.0 ); // 0% for *this job* connect( jobitem.job.data(), &Job::progress, this, &JobThread::emitProgress ); auto result = jobitem.job->exec(); if ( !failureEncountered && !result ) @@ -173,8 +175,14 @@ private: if ( m_jobIndex < m_runningJobs->count() ) { const auto& jobitem = m_runningJobs->at( m_jobIndex ); + cDebug() << "Job" << ( m_jobIndex + 1 ) << jobitem.job->prettyName() << "+wt" << jobitem.weight << "start.wt" + << jobitem.cumulative; progress = ( jobitem.cumulative + jobitem.weight * percentage ) / m_overallQueueWeight; message = jobitem.job->prettyStatusMessage(); + cDebug() << Logger::SubEntry << ( double( int( percentage * 1000 ) ) / 10.0 ) << "% +wt" + << ( jobitem.weight * percentage ) << " completed.wt" + << ( jobitem.cumulative + jobitem.weight * percentage ) << "tot %" + << ( double( int( progress * 1000 ) ) / 10.0 ); } else {