#include "closestream.h"
#include "path.h"
#include "pathnames.h"
-#include "procutils.h"
+#include "procfs.h"
#include "sched_attr.h"
#include "strutils.h"
if (cmd)
comm = cmd;
else
- comm = proc_get_command_name(pid);
+ comm = pid_get_cmdname(pid);
printf(_("%s (%d) util_clamp: min: %d max: %d\n"),
comm ? : "unknown", pid, sa.sched_util_min, sa.sched_util_max);
if (ctl->system) {
show_uclamp_system_info();
} else if (ctl->all_tasks) {
+ DIR *sub = NULL;
pid_t tid;
- struct proc_tasks *ts = proc_open_tasks(ctl->pid);
+ struct path_cxt *pc = ul_new_procfs_path(ctl->pid, NULL);
- if (!ts)
+ if (!pc)
err(EXIT_FAILURE, _("cannot obtain the list of tasks"));
- while (!proc_next_tid(ts, &tid))
+ while (procfs_process_next_tid(pc, &sub, &tid) == 0)
show_uclamp_pid_info(tid, NULL);
- proc_close_tasks(ts);
+ ul_unref_path(pc);
} else {
show_uclamp_pid_info(ctl->pid, ctl->cmd);
}
static void set_uclamp_pid(struct uclampset *ctl)
{
if (ctl->all_tasks) {
+ DIR *sub = NULL;
pid_t tid;
- struct proc_tasks *ts = proc_open_tasks(ctl->pid);
+ struct path_cxt *pc = ul_new_procfs_path(ctl->pid, NULL);
- if (!ts)
+ if (!pc)
err(EXIT_FAILURE, _("cannot obtain the list of tasks"));
- while (!proc_next_tid(ts, &tid))
+ while (procfs_process_next_tid(pc, &sub, &tid) == 0) {
if (set_uclamp_one(ctl, tid) == -1)
err(EXIT_FAILURE, _("failed to set tid %d's uclamp values"), tid);
-
- proc_close_tasks(ts);
+ }
+ ul_unref_path(pc);
} else if (set_uclamp_one(ctl, ctl->pid) == -1) {
err(EXIT_FAILURE, _("failed to set pid %d's uclamp values"), ctl->pid);