2012-12-05 15:12:20 +00:00
|
|
|
#ifndef HEADER_Affinity
|
|
|
|
#define HEADER_Affinity
|
|
|
|
/*
|
|
|
|
htop - Affinity.h
|
|
|
|
(C) 2004-2011 Hisham H. Muhammad
|
2020-08-19 23:35:24 +00:00
|
|
|
(C) 2020 Red Hat, Inc. All Rights Reserved.
|
2012-12-05 15:12:20 +00:00
|
|
|
Released under the GNU GPL, see the COPYING file
|
|
|
|
in the source distribution for its full text.
|
|
|
|
*/
|
|
|
|
|
2015-01-22 01:27:31 +00:00
|
|
|
#ifdef HAVE_LIBHWLOC
|
2016-02-14 21:57:29 +00:00
|
|
|
#if __linux__
|
|
|
|
#define HTOP_HWLOC_CPUBIND_FLAG HWLOC_CPUBIND_THREAD
|
|
|
|
#else
|
|
|
|
#define HTOP_HWLOC_CPUBIND_FLAG HWLOC_CPUBIND_PROCESS
|
|
|
|
#endif
|
|
|
|
#elif HAVE_LINUX_AFFINITY
|
2015-01-22 01:27:31 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "Process.h"
|
|
|
|
#include "ProcessList.h"
|
2012-12-05 15:12:20 +00:00
|
|
|
|
|
|
|
typedef struct Affinity_ {
|
2015-01-22 01:27:31 +00:00
|
|
|
ProcessList* pl;
|
2012-12-05 15:12:20 +00:00
|
|
|
int size;
|
|
|
|
int used;
|
|
|
|
int* cpus;
|
|
|
|
} Affinity;
|
|
|
|
|
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
Affinity* Affinity_new(ProcessList* pl);
|
2012-12-05 15:12:20 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
void Affinity_delete(Affinity* this);
|
2012-12-05 15:12:20 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
void Affinity_add(Affinity* this, int id);
|
2012-12-05 15:12:20 +00:00
|
|
|
|
2015-01-22 01:27:31 +00:00
|
|
|
#ifdef HAVE_LIBHWLOC
|
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
Affinity* Affinity_get(Process* proc, ProcessList* pl);
|
2015-01-22 01:27:31 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
bool Affinity_set(Process* proc, Arg arg);
|
2015-01-22 01:27:31 +00:00
|
|
|
|
2016-02-14 21:57:29 +00:00
|
|
|
#elif HAVE_LINUX_AFFINITY
|
2015-01-22 01:27:31 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
Affinity* Affinity_get(Process* proc, ProcessList* pl);
|
2015-01-22 01:27:31 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
bool Affinity_set(Process* proc, Arg arg);
|
2015-01-22 01:27:31 +00:00
|
|
|
|
|
|
|
#endif
|
2012-12-05 15:12:20 +00:00
|
|
|
|
|
|
|
#endif
|