Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:olh:xen-4.3
xen-tscinfo
xen-tscinfo.c
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xen-tscinfo.c of Package xen-tscinfo
/* gcc -Wall -o xen-tscinfo -O -lxenctrl xen-tscinfo.c */ #include <unistd.h> #include <errno.h> #include <stdlib.h> #include <stdio.h> #include <xenctrl.h> int main(int argc, char *argv[]) { xc_interface *xch; unsigned int domid; int rc, ret = 1; unsigned int lflags; xentoollog_level lvl; xentoollog_logger *l; const char *tsc; unsigned int tsc_mode, khz, incarn; uint64_t nsec; if (argc > 1) domid = atoi(argv[1]); errno = 0; lvl = XTL_DEBUG; lflags = XTL_STDIOSTREAM_SHOW_PID | XTL_STDIOSTREAM_HIDE_PROGRESS; l = (xentoollog_logger *) xtl_createlogger_stdiostream(stderr, lvl, lflags); if (!l) goto out; xch = xc_interface_open(l, 0, 0); if (!xch) goto out; rc = xc_domain_get_tsc_info(xch, domid, &tsc_mode, &nsec, &khz, &incarn); if (rc < 0) goto out; switch (tsc_mode) { case 0: tsc = "default"; break; case 1: tsc = "always_emulate"; break; case 2: tsc = "native"; break; case 3: tsc = "native_paravirt"; break; default: tsc = "unhandled"; break; } printf("domid=%u\ntsc_mode=%s\ntsc_mode_val=%u\ndomU_khz=%u\nincarnation=%u\nelapsed_nsec=%llu\n", domid, tsc, tsc_mode, khz, incarn, (unsigned long long)nsec); ret = 0; out: perror(argv[0]); return ret; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor