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 593779 Details for
Bug 804890
[rhel5]: sar can not show correct name for virtio devices.
[?]
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.
[patch]
sysstat-7.0.2-sysfs-devname.patch
sysstat-7.0.2-sysfs-devname.patch (text/plain), 1.90 KB, created by
Peter Schiffer
on 2012-06-22 15:17:23 UTC
(
hide
)
Description:
sysstat-7.0.2-sysfs-devname.patch
Filename:
MIME Type:
Creator:
Peter Schiffer
Created:
2012-06-22 15:17:23 UTC
Size:
1.90 KB
patch
obsolete
>diff -upr sysstat-7.0.2.orig/sa_common.c sysstat-7.0.2/sa_common.c >--- sysstat-7.0.2.orig/sa_common.c 2012-06-22 16:54:05.497367295 +0200 >+++ sysstat-7.0.2/sa_common.c 2012-06-22 16:57:51.836753718 +0200 >@@ -27,6 +27,7 @@ > #include <unistd.h> /* For STDOUT_FILENO, among others */ > #include <dirent.h> > #include <fcntl.h> >+#include <libgen.h> > #include <sys/types.h> > #include <sys/ioctl.h> > >@@ -150,6 +151,42 @@ void salloc_disk_array(struct disk_stats > > /* > *************************************************************************** >+ * Try to get device real name from sysfs tree. >+ * >+ * IN: >+ * @major Major number of the device. >+ * @minor Minor number of the device. >+ * >+ * RETURNS: >+ * The name of the device, which may be the real name (as it appears in /dev) >+ * or NULL. >+ *************************************************************************** >+ */ >+char *get_devname_from_sysfs(unsigned int major, unsigned int minor) >+{ >+ static char link[32], target[PATH_MAX]; >+ char *devname; >+ ssize_t r; >+ >+ snprintf(link, 32, "/sys/dev/block/%d:%d", major, minor); >+ >+ r = readlink(link, target, PATH_MAX); >+ if (r <= 0 || r >= PATH_MAX) { >+ return (NULL); >+ } >+ >+ target[r] = '\0'; >+ >+ devname = basename(target); >+ if (!devname || strnlen(devname, FILENAME_MAX) == 0) { >+ return (NULL); >+ } >+ >+ return (devname); >+} >+ >+/* >+ *************************************************************************** > * Get device real name if possible. > * Warning: This routine may return a bad name on 2.4 kernels where > * disk activities are read from /proc/stat. >@@ -164,10 +201,12 @@ char *get_devname(unsigned int major, un > > if (!pretty) > return (buf); >- if ((name = ioc_name(major, minor)) == NULL) >- return (buf); >+ if ((name = ioc_name(major, minor)) != NULL) >+ return (name); >+ if ((name = get_devname_from_sysfs(major, minor)) != NULL) >+ return (name); > >- return (name); >+ return (buf); > } > >
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 804890
:
593779
|
862934