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
|
|
|
#include "Process.h"
|
|
|
|
#include "ProcessList.h"
|
2012-12-05 15:12:20 +00:00
|
|
|
|
2020-09-08 14:25:22 +00:00
|
|
|
#if defined(HAVE_LIBHWLOC) && defined(HAVE_LINUX_AFFINITY)
|
|
|
|
#error hwlock and linux affinity are mutual exclusive.
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
|
2020-09-12 22:18:23 +00:00
|
|
|
#if defined(HAVE_LIBHWLOC) || defined(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
|