static void *kvm_cpu_thread(void *arg)
{
- current_kvm_cpu = arg;
+ char name[16];
+
+ current_kvm_cpu = arg;
+
+ sprintf(name, "kvm-vcpu-%lu", current_kvm_cpu->cpu_id);
+ kvm__set_thread_name(name);
if (kvm_cpu__start(current_kvm_cpu))
goto panic_kvm;
int nr, i;
u64 dummy;
+ kvm__set_thread_name("disk-image-io");
+
while (read(disk->evt, &dummy, sizeof(dummy)) > 0) {
nr = io_getevents(disk->ctx, 1, ARRAY_SIZE(event), event, ¬ime);
for (i = 0; i < nr; i++)
#include <linux/types.h>
#include <time.h>
#include <signal.h>
+#include <sys/prctl.h>
#define SIGKVMEXIT (SIGRTMIN + 0)
#define SIGKVMPAUSE (SIGRTMIN + 1)
bool kvm__supports_extension(struct kvm *kvm, unsigned int extension);
+static inline void kvm__set_thread_name(const char *name)
+{
+ prctl(PR_SET_NAME, name);
+}
+
#endif /* KVM__KVM_H */
{
u64 tmp = 1;
+ kvm__set_thread_name("ioeventfd-worker");
+
for (;;) {
int nfds, i;
struct epoll_event event;
struct kvm *kvm = param;
+ kvm__set_thread_name("kvm-ipc");
+
for (;;) {
int nfds;
#include "kvm/uip.h"
+#include <kvm/kvm.h>
#include <linux/virtio_net.h>
#include <linux/kernel.h>
#include <linux/list.h>
int len, left, ret;
u8 *payload, *pos;
+ kvm__set_thread_name("uip-tcp");
+
sk = p;
payload = malloc(UIP_MAX_TCP_PAYLOAD);
#include "kvm/uip.h"
+#include <kvm/kvm.h>
#include <linux/virtio_net.h>
#include <linux/kernel.h>
#include <linux/list.h>
int nfds;
int i;
+ kvm__set_thread_name("uip-udp");
+
info = p;
do {
SDL_Event ev;
Uint32 flags;
+ kvm__set_thread_name("kvm-sdl-worker");
+
if (SDL_Init(SDL_INIT_VIDEO) != 0)
die("Unable to initialize SDL");
char argv[1][1] = {{0}};
int argc = 1;
+ kvm__set_thread_name("kvm-vnc-worker");
+
server = rfbGetScreen(&argc, (char **) argv, fb->width, fb->height, 8, 3, 4);
server->frameBuffer = fb->mem;
server->alwaysShared = TRUE;
{
pthread_cleanup_push(thread_pool__threadfunc_cleanup, NULL);
+ kvm__set_thread_name("threadpool-worker");
+
while (running) {
struct thread_pool__job *curjob = NULL;
u64 data;
int r;
+ kvm__set_thread_name("virtio-blk-io");
+
while (1) {
r = read(bdev->io_efd, &data, sizeof(u64));
if (r < 0)
u16 head;
int len;
+ kvm__set_thread_name("virtio-net-rx");
+
kvm = ndev->kvm;
vq = &ndev->vqs[VIRTIO_NET_RX_QUEUE];
u16 head;
int len;
+ kvm__set_thread_name("virtio-net-tx");
+
kvm = ndev->kvm;
vq = &ndev->vqs[VIRTIO_NET_TX_QUEUE];