Displaying 13 results from an estimated 13 matches for "cpu_set_t".
Did you mean:
cpu_set
2019 Aug 31
3
Get constants of undefined types in IR
Hello all,
I would like to obtain a constant that is initialized with a value of type cpu_set_t, a type which is defined by Pthreads. The problem is that a variable of this type cannot be cast to an int value, even in C source code. I tried get methods from Constant or ConstantInt classes, but with no result.
How can I obtain such constant object in IR?
Thank you,
Iulia
--------------...
2019 Sep 03
2
Get constants of undefined types in IR
...GMT+3, Tim Northover <t.p.northover at gmail.com> wrote:
Adding llvm-dev back.
On Tue, 3 Sep 2019 at 18:02, Iulia Stirb <iulia_s24 at yahoo.com> wrote:
Thank very much you for your answer. Following the indications in your mail, I obtained one of the 16th elements as below:
static cpu_set_t getCpuAffinityElement(cpu_set_t affinity, int index) { cpu_set_t mask; CPU_ZERO(&mask); for(int i = index * sizeof(unsigned long); i < (index + 1) * sizeof(unsigned long); i++) { CPU_SET(i,&mask); } CPU_AND(&affinity, &affinity, &mask); return affinity; }
That looks like a w...
2018 Jan 24
0
libasan bug: pthread_create never returns
..._worker(void *ptr)
{
printf("Hello from worker\n");
return NULL;
}
int
main(void)
{
struct sched_param schedule;
schedule.sched_priority = 50;
if (sched_setscheduler(getpid(), SCHED_RR, &schedule) == 1) {
perror("sched_setscheduler");
exit(EXIT_FAILURE);
}
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
CPU_SET(1, &cpuset);
if (sched_setaffinity(getpid(), sizeof(cpuset), &cpuset) == -1) {
perror("sched_setaffinity");
exit(EXIT_FAILURE);
}
printf("Hey from main\n");
schedule.sched_priority = 20;
pthread_attr_t attr;...
2016 Jan 21
1
[PATCH] tools/virtio: add ringtest utilities
...eof v);
+ assert(r == sizeof v);
+ vmentry();
+}
+
+void kick(void)
+{
+ notify(kickfd);
+}
+
+void wait_for_kick(void)
+{
+ wait_for_notify(kickfd);
+}
+
+void call(void)
+{
+ notify(callfd);
+}
+
+void wait_for_call(void)
+{
+ wait_for_notify(callfd);
+}
+
+void set_affinity(const char *arg)
+{
+ cpu_set_t cpuset;
+ int ret;
+ pthread_t self;
+ long int cpu;
+ char *endptr;
+
+ if (!arg)
+ return;
+
+ cpu = strtol(arg, &endptr, 0);
+ assert(!*endptr);
+
+ assert(cpu >= 0 || cpu < CPU_SETSIZE);
+
+ self = pthread_self();
+ CPU_ZERO(&cpuset);
+ CPU_SET(cpu, &cpuset);
+
+ ret = pthrea...
2016 Jan 21
1
[PATCH] tools/virtio: add ringtest utilities
...eof v);
+ assert(r == sizeof v);
+ vmentry();
+}
+
+void kick(void)
+{
+ notify(kickfd);
+}
+
+void wait_for_kick(void)
+{
+ wait_for_notify(kickfd);
+}
+
+void call(void)
+{
+ notify(callfd);
+}
+
+void wait_for_call(void)
+{
+ wait_for_notify(callfd);
+}
+
+void set_affinity(const char *arg)
+{
+ cpu_set_t cpuset;
+ int ret;
+ pthread_t self;
+ long int cpu;
+ char *endptr;
+
+ if (!arg)
+ return;
+
+ cpu = strtol(arg, &endptr, 0);
+ assert(!*endptr);
+
+ assert(cpu >= 0 || cpu < CPU_SETSIZE);
+
+ self = pthread_self();
+ CPU_ZERO(&cpuset);
+ CPU_SET(cpu, &cpuset);
+
+ ret = pthrea...
2013 Feb 18
9
[PATCH 0/5] vringh
This introduces vringh, which are generic accessors for virtio rings (host side).
There's a host-side implementation in vhost, but it assumes that the rings are
in userspace, and is tied to the vhost implementation. I have patches to adapt
it to use vringh, but I'm pushing this in the next merge window for Sjur, who has
CAIF patches which need it.
This also includes a test program in
2013 Feb 18
9
[PATCH 0/5] vringh
This introduces vringh, which are generic accessors for virtio rings (host side).
There's a host-side implementation in vhost, but it assumes that the rings are
in userspace, and is tied to the vhost implementation. I have patches to adapt
it to use vringh, but I'm pushing this in the next merge window for Sjur, who has
CAIF patches which need it.
This also includes a test program in
2012 Aug 09
8
[PATCH V2 0/6] virtio-trace: Support virtio-trace
Hi All,
The following patch set provides a low-overhead system for collecting kernel
tracing data of guests by a host in a virtualization environment.
A guest OS generally shares some devices with other guests or a host, so
reasons of any problems occurring in a guest may be from other guests or a host.
Then, to collect some tracing data of a number of guests and a host is needed
when some
2012 Aug 09
8
[PATCH V2 0/6] virtio-trace: Support virtio-trace
Hi All,
The following patch set provides a low-overhead system for collecting kernel
tracing data of guests by a host in a virtualization environment.
A guest OS generally shares some devices with other guests or a host, so
reasons of any problems occurring in a guest may be from other guests or a host.
Then, to collect some tracing data of a number of guests and a host is needed
when some
2012 Jul 24
13
[RFC PATCH 0/6] virtio-trace: Support virtio-trace
Hi All,
The following patch set provides a low-overhead system for collecting kernel
tracing data of guests by a host in a virtualization environment.
A guest OS generally shares some devices with other guests or a host, so
reasons of any problems occurring in a guest may be from other guests or a host.
Then, to collect some tracing data of a number of guests and a host is needed
when some
2012 Jul 24
13
[RFC PATCH 0/6] virtio-trace: Support virtio-trace
Hi All,
The following patch set provides a low-overhead system for collecting kernel
tracing data of guests by a host in a virtualization environment.
A guest OS generally shares some devices with other guests or a host, so
reasons of any problems occurring in a guest may be from other guests or a host.
Then, to collect some tracing data of a number of guests and a host is needed
when some
2013 Jan 17
8
[PATCH 1/6] virtio_host: host-side implementation of virtio rings.
Getting use of virtio rings correct is tricky, and a recent patch saw
an implementation of in-kernel rings (as separate from userspace).
This patch attempts to abstract the business of dealing with the
virtio ring layout from the access (userspace or direct); to do this,
we use function pointers, which gcc inlines correctly.
Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
---
2013 Jan 17
8
[PATCH 1/6] virtio_host: host-side implementation of virtio rings.
Getting use of virtio rings correct is tricky, and a recent patch saw
an implementation of in-kernel rings (as separate from userspace).
This patch attempts to abstract the business of dealing with the
virtio ring layout from the access (userspace or direct); to do this,
we use function pointers, which gcc inlines correctly.
Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
---