aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-07-25 08:23:20 +0530
committersinanmohd <sinan@sinanmohd.com>2024-07-25 08:23:20 +0530
commitaf7adc72f8017755018eea68aac520a2f53b3581 (patch)
tree22e4c09d48a89a539dd7709f1591bd8a681e2a85 /src
parentf1fbce3d224864c8ba04c15e2f41853e347933f9 (diff)
solver_greedy/solver_report: remove redundant data
Diffstat (limited to 'src')
-rw-r--r--src/jobs.c1
-rw-r--r--src/solver_greedy.c26
2 files changed, 4 insertions, 23 deletions
diff --git a/src/jobs.c b/src/jobs.c
index 991d21b..83a18c8 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -443,7 +443,6 @@ static int job_new(struct job **j, char *name, char *drv_path, char *attr,
return -errno;
}
job->scheduled = false;
- job->reported = false;
job->id = -1;
job->outputs_size = 0;
diff --git a/src/solver_greedy.c b/src/solver_greedy.c
index 4fcea00..09b026f 100644
--- a/src/solver_greedy.c
+++ b/src/solver_greedy.c
@@ -35,21 +35,6 @@ static float conformity(struct job *job)
return conformity;
}
-static void solver_report(struct job *job, int32_t resources)
-{
- if (!evanix_opts.solver_report)
- return;
- else if (job->reported)
- return;
-
- job->reported = true;
- printf("❌ cost: %2d > %2d <-> %s -> %s\n", job_cost_recursive(job),
- resources, job->name, job->drv_path);
-
- for (size_t i = 0; i < job->parents_filled; i++)
- solver_report(job->parents[i], resources);
-}
-
int solver_greedy(struct job **job, struct job_clist *q, int32_t resources)
{
struct job *j;
@@ -63,8 +48,10 @@ int solver_greedy(struct job **job, struct job_clist *q, int32_t resources)
continue;
} else if (job_cost_recursive(j) > resources) {
job_stale_set(j);
- solver_report(j, resources);
- continue;
+ if (evanix_opts.solver_report) {
+ printf("❌ refusing to build %s, cost: %d\n",
+ j->drv_path, job_cost_recursive(j));
+ }
}
}
@@ -80,11 +67,6 @@ int solver_greedy(struct job **job, struct job_clist *q, int32_t resources)
selected->deps_filled > j->deps_filled) {
selected = j;
}
-
- if (!evanix_opts.solver_report)
- continue;
- printf("ℹī¸ cost: %2d, conformity: %.2f -> %s\n",
- job_cost_recursive(j), conformity_cur, j->drv_path);
}
if (selected == NULL)