From: Cyril Hrubis <chrubis@suse.cz>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH] Add autoconf tests for taskstats members not present on older kernels
Date: Mon, 31 Aug 2009 13:51:55 +0200 [thread overview]
Message-ID: <20090831115155.GA8921@schrodinger.suse.cz> (raw)
[-- Attachment #1: Type: text/plain, Size: 135 bytes --]
Hi,
this is cleaned version of previously posted patch.
Signed-off-by: Cyril Hrubis chrubis@suse.cz
--
Cyril Hrubis
chrubis@suse.cz
[-- Attachment #2: getdalays_no_cgroupstats_h.patch --]
[-- Type: text/x-patch, Size: 2019 bytes --]
Index: ltp-full-20090731/testcases/kernel/controllers/cgroup/getdelays.c
===================================================================
--- ltp-full-20090731.orig/testcases/kernel/controllers/cgroup/getdelays.c
+++ ltp-full-20090731/testcases/kernel/controllers/cgroup/getdelays.c
@@ -23,11 +23,15 @@
#include <sys/socket.h>
#include <signal.h>
+#include "config.h"
+
#include <linux/genetlink.h>
#include <linux/taskstats.h>
+
+#ifdef HAVE_LINUX_CGROUPSTATS_H
#include <linux/cgroupstats.h>
+#endif
-#include "config.h"
/*
* Generic macros for dealing with netlink sockets. Might be duplicated
* elsewhere. It is recommended that commercial grade applications use
@@ -232,6 +236,8 @@ void task_context_switch_counts(struct t
#endif
}
+#ifdef HAVE_LINUX_CGROUPSTATS_H
+
void print_cgroupstats(struct cgroupstats *c)
{
printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, "
@@ -242,6 +248,7 @@ void print_cgroupstats(struct cgroupstat
(unsigned long long)c->nr_uninterruptible);
}
+#endif
void print_ioacct(struct taskstats *t)
{
@@ -390,6 +397,7 @@ int main(int argc, char *argv[])
}
if (containerset) {
+#ifdef HAVE_LINUX_CGROUPSTAT_H
cfd = open(containerpath, O_RDONLY);
if (cfd < 0) {
perror("error opening container file");
@@ -401,6 +409,10 @@ int main(int argc, char *argv[])
perror("error sending cgroupstats command");
exit(1);
}
+#else
+ printf("Header linux/cgroupstat.h was missing during compilation,"
+ "you may have old or incomplete kernel-headers.\n");
+#endif
}
if (!maskset && !tid && !containerset) {
usage();
@@ -484,10 +496,11 @@ int main(int argc, char *argv[])
na = (struct nlattr *) ((char *) na + len2);
}
break;
-
+#ifdef HAVE_LINUX_CGROUPSTATS_H
case CGROUPSTATS_TYPE_CGROUP_STATS:
print_cgroupstats(NLA_DATA(na));
break;
+#endif
default:
fprintf(stderr, "Unknown nla_type %d\n",
na->nla_type);
@@ -513,3 +526,4 @@ done:
close(cfd);
return 0;
}
+
[-- Attachment #3: Type: text/plain, Size: 355 bytes --]
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
[-- Attachment #4: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next reply other threads:[~2009-08-31 11:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-31 11:51 Cyril Hrubis [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-08-28 15:24 [LTP] [PATCH] Add autoconf tests for taskstats members not present on older kernels Cyril Hrubis
[not found] ` <200908281144.24993.vapier@gentoo.org>
2009-08-28 16:02 ` [LTP] [PATCH] Add autoconf tests for taskstats members not present?on " Cyril Hrubis
[not found] <200907071050.n67AooL6008612@e5.ny.us.ibm.com>
2009-07-07 15:32 ` [LTP] [PATCH] Add autoconf tests for taskstats members not present on " Subrata Modak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090831115155.GA8921@schrodinger.suse.cz \
--to=chrubis@suse.cz \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox