Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 583641 Details for
Bug 820500
Test program segfaults when trying to obtain Guest metrics from vhostmd
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Updated test program to gather host and guest metrics from vhostmd
test-1.c (text/plain), 2.25 KB, created by
Dinakar Guniguntala
on 2012-05-10 17:11:15 UTC
(
hide
)
Description:
Updated test program to gather host and guest metrics from vhostmd
Filename:
MIME Type:
Creator:
Dinakar Guniguntala
Created:
2012-05-10 17:11:15 UTC
Size:
2.25 KB
patch
obsolete
>/* > * This program is free software; you can redistribute it and/or modify > * it under the terms of the GNU General Public License, version 2, as > * published by the Free Software Foundation. > * > * This program is distributed in the hope that it will be useful, > * but WITHOUT ANY WARRANTY; without even the implied warranty of > * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > * GNU General Public License for more details. > * > * You should have received a copy of the GNU General Public License > * along with this program; if not, write to the Free Software > * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. > * > * Copyright IBM Corp. 2012 > * > * Test program to gather host and guest metrics from vhostmd > * > * Author: Dinakar Guniguntala <dino@in.ibm.com> > */ >#include <stdio.h> >#include <stdlib.h> >#include <dlfcn.h> >#include <vhostmd/libmetrics.h> > >#define METRICS_LIB "libmetrics.so" >#define XML2_LIB "libxml2.so" >#define XEN_STORE "libxenstore.so" > >int >main(int argc, char **argv) >{ > metric *m; > char *error; > void *metrics, *xml2, *xenstore; > > int (*get_metric)(const char *name, metric **rec, metric_context context); > void (*metric_free)(metric *); > > xenstore = dlopen(XEN_STORE, RTLD_NOW|RTLD_GLOBAL); > if (!xenstore) { > fprintf(stderr, "%s\n", dlerror()); > exit(-1); > } > > xml2 = dlopen(XML2_LIB, RTLD_NOW|RTLD_GLOBAL); > if (!xml2) { > fprintf(stderr, "%s\n", dlerror()); > exit(-1); > } > > metrics = dlopen(METRICS_LIB, RTLD_NOW); > if (!metrics) { > fprintf(stderr, "%s\n", dlerror()); > exit(-1); > } > > dlerror(); > > get_metric = dlsym(metrics, "get_metric"); > if ((error = dlerror()) != NULL) { > fprintf(stderr, "%s\n", error); > exit(-1); > } > metric_free = dlsym(metrics, "metric_free"); > if ((error = dlerror()) != NULL) { > fprintf(stderr, "%s\n", error); > exit(-1); > } > > if (get_metric("TotalCPUTime", &m, METRIC_CONTEXT_HOST) == 0) { > printf("Host: TotalCPUTime: %12.2f\n", m->value.r64); > } > else { > printf("Host: TotalCPUTime: metric not found\n"); > } > metric_free(m); > > if (get_metric("TotalCPUTime", &m, METRIC_CONTEXT_VM) == 0) { > printf("VM: TotalCPUTime: %12.2f\n", m->value.r64); > } > else { > printf("VM: TotalCPUTime: metric not found\n"); > } > metric_free(m); > > dlclose(metrics); > dlclose(xml2); > dlclose(xenstore); > exit(0); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 820500
:
583474
|
583488
| 583641