Re: [PATCH 12/14] perf tests: Add test interface for dso data fd limit

2014-05-27 Thread Jiri Olsa
On Tue, May 27, 2014 at 10:10:40AM +0900, Namhyung Kim wrote:
> On Thu, 15 May 2014 19:23:33 +0200, Jiri Olsa wrote:
> > Adding a way to setup test dso limit by global variable
> > test_dso_data__fd_limit. It'll be used in the dso data
> > cache tests.
> 
> Why is this needed?  Why not justing setting RLIMIT_NOFILE in the test
> cases?

well, I wanted to avoid to customizing the test to the current
open files count state.. the way with artifical limit is easier
and more clean IMO ;-)

I'll see if I can make the setup without this one

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 12/14] perf tests: Add test interface for dso data fd limit

2014-05-27 Thread Jiri Olsa
On Tue, May 27, 2014 at 10:10:40AM +0900, Namhyung Kim wrote:
 On Thu, 15 May 2014 19:23:33 +0200, Jiri Olsa wrote:
  Adding a way to setup test dso limit by global variable
  test_dso_data__fd_limit. It'll be used in the dso data
  cache tests.
 
 Why is this needed?  Why not justing setting RLIMIT_NOFILE in the test
 cases?

well, I wanted to avoid to customizing the test to the current
open files count state.. the way with artifical limit is easier
and more clean IMO ;-)

I'll see if I can make the setup without this one

thanks,
jirka
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 12/14] perf tests: Add test interface for dso data fd limit

2014-05-26 Thread Namhyung Kim
On Thu, 15 May 2014 19:23:33 +0200, Jiri Olsa wrote:
> Adding a way to setup test dso limit by global variable
> test_dso_data__fd_limit. It'll be used in the dso data
> cache tests.

Why is this needed?  Why not justing setting RLIMIT_NOFILE in the test
cases?

Thanks,
Namhyung

>
> Cc: Arnaldo Carvalho de Melo 
> Cc: Corey Ashford 
> Cc: David Ahern 
> Cc: Frederic Weisbecker 
> Cc: Ingo Molnar 
> Cc: Jean Pihet 
> Cc: Namhyung Kim 
> Cc: Paul Mackerras 
> Cc: Peter Zijlstra 
> Signed-off-by: Jiri Olsa 
> ---
>  tools/perf/util/dso.c | 5 +
>  tools/perf/util/dso.h | 3 +++
>  2 files changed, 8 insertions(+)
>
> diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
> index 80b54e7..9310369 100644
> --- a/tools/perf/util/dso.c
> +++ b/tools/perf/util/dso.c
> @@ -7,6 +7,8 @@
>  #include "util.h"
>  #include "debug.h"
>  
> +rlim_t test_dso_data__fd_limit;
> +
>  char dso__symtab_origin(const struct dso *dso)
>  {
>   static const char origin[] = {
> @@ -262,6 +264,9 @@ static bool may_cache_fd(void)
>   if (!limit)
>   limit = get_fd_limit();
>  
> + if (unlikely(test_dso_data__fd_limit))
> + limit = test_dso_data__fd_limit;
> +
>   if (limit == RLIM_INFINITY)
>   return true;
>  
> diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
> index d713184..3807014 100644
> --- a/tools/perf/util/dso.h
> +++ b/tools/perf/util/dso.h
> @@ -1,6 +1,7 @@
>  #ifndef __PERF_DSO
>  #define __PERF_DSO
>  
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -8,6 +9,8 @@
>  #include "map.h"
>  #include "build-id.h"
>  
> +extern rlim_t test_dso_data__fd_limit;
> +
>  enum dso_binary_type {
>   DSO_BINARY_TYPE__KALLSYMS = 0,
>   DSO_BINARY_TYPE__GUEST_KALLSYMS,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 12/14] perf tests: Add test interface for dso data fd limit

2014-05-26 Thread Namhyung Kim
On Thu, 15 May 2014 19:23:33 +0200, Jiri Olsa wrote:
 Adding a way to setup test dso limit by global variable
 test_dso_data__fd_limit. It'll be used in the dso data
 cache tests.

Why is this needed?  Why not justing setting RLIMIT_NOFILE in the test
cases?

Thanks,
Namhyung


 Cc: Arnaldo Carvalho de Melo a...@kernel.org
 Cc: Corey Ashford cjash...@linux.vnet.ibm.com
 Cc: David Ahern dsah...@gmail.com
 Cc: Frederic Weisbecker fweis...@gmail.com
 Cc: Ingo Molnar mi...@kernel.org
 Cc: Jean Pihet jean.pi...@linaro.org
 Cc: Namhyung Kim namhy...@kernel.org
 Cc: Paul Mackerras pau...@samba.org
 Cc: Peter Zijlstra a.p.zijls...@chello.nl
 Signed-off-by: Jiri Olsa jo...@kernel.org
 ---
  tools/perf/util/dso.c | 5 +
  tools/perf/util/dso.h | 3 +++
  2 files changed, 8 insertions(+)

 diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
 index 80b54e7..9310369 100644
 --- a/tools/perf/util/dso.c
 +++ b/tools/perf/util/dso.c
 @@ -7,6 +7,8 @@
  #include util.h
  #include debug.h
  
 +rlim_t test_dso_data__fd_limit;
 +
  char dso__symtab_origin(const struct dso *dso)
  {
   static const char origin[] = {
 @@ -262,6 +264,9 @@ static bool may_cache_fd(void)
   if (!limit)
   limit = get_fd_limit();
  
 + if (unlikely(test_dso_data__fd_limit))
 + limit = test_dso_data__fd_limit;
 +
   if (limit == RLIM_INFINITY)
   return true;
  
 diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
 index d713184..3807014 100644
 --- a/tools/perf/util/dso.h
 +++ b/tools/perf/util/dso.h
 @@ -1,6 +1,7 @@
  #ifndef __PERF_DSO
  #define __PERF_DSO
  
 +#include sys/resource.h
  #include linux/types.h
  #include linux/rbtree.h
  #include stdbool.h
 @@ -8,6 +9,8 @@
  #include map.h
  #include build-id.h
  
 +extern rlim_t test_dso_data__fd_limit;
 +
  enum dso_binary_type {
   DSO_BINARY_TYPE__KALLSYMS = 0,
   DSO_BINARY_TYPE__GUEST_KALLSYMS,
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 12/14] perf tests: Add test interface for dso data fd limit

2014-05-15 Thread Jiri Olsa
Adding a way to setup test dso limit by global variable
test_dso_data__fd_limit. It'll be used in the dso data
cache tests.

Cc: Arnaldo Carvalho de Melo 
Cc: Corey Ashford 
Cc: David Ahern 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jean Pihet 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Signed-off-by: Jiri Olsa 
---
 tools/perf/util/dso.c | 5 +
 tools/perf/util/dso.h | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 80b54e7..9310369 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -7,6 +7,8 @@
 #include "util.h"
 #include "debug.h"
 
+rlim_t test_dso_data__fd_limit;
+
 char dso__symtab_origin(const struct dso *dso)
 {
static const char origin[] = {
@@ -262,6 +264,9 @@ static bool may_cache_fd(void)
if (!limit)
limit = get_fd_limit();
 
+   if (unlikely(test_dso_data__fd_limit))
+   limit = test_dso_data__fd_limit;
+
if (limit == RLIM_INFINITY)
return true;
 
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index d713184..3807014 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -1,6 +1,7 @@
 #ifndef __PERF_DSO
 #define __PERF_DSO
 
+#include 
 #include 
 #include 
 #include 
@@ -8,6 +9,8 @@
 #include "map.h"
 #include "build-id.h"
 
+extern rlim_t test_dso_data__fd_limit;
+
 enum dso_binary_type {
DSO_BINARY_TYPE__KALLSYMS = 0,
DSO_BINARY_TYPE__GUEST_KALLSYMS,
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 12/14] perf tests: Add test interface for dso data fd limit

2014-05-15 Thread Jiri Olsa
Adding a way to setup test dso limit by global variable
test_dso_data__fd_limit. It'll be used in the dso data
cache tests.

Cc: Arnaldo Carvalho de Melo a...@kernel.org
Cc: Corey Ashford cjash...@linux.vnet.ibm.com
Cc: David Ahern dsah...@gmail.com
Cc: Frederic Weisbecker fweis...@gmail.com
Cc: Ingo Molnar mi...@kernel.org
Cc: Jean Pihet jean.pi...@linaro.org
Cc: Namhyung Kim namhy...@kernel.org
Cc: Paul Mackerras pau...@samba.org
Cc: Peter Zijlstra a.p.zijls...@chello.nl
Signed-off-by: Jiri Olsa jo...@kernel.org
---
 tools/perf/util/dso.c | 5 +
 tools/perf/util/dso.h | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 80b54e7..9310369 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -7,6 +7,8 @@
 #include util.h
 #include debug.h
 
+rlim_t test_dso_data__fd_limit;
+
 char dso__symtab_origin(const struct dso *dso)
 {
static const char origin[] = {
@@ -262,6 +264,9 @@ static bool may_cache_fd(void)
if (!limit)
limit = get_fd_limit();
 
+   if (unlikely(test_dso_data__fd_limit))
+   limit = test_dso_data__fd_limit;
+
if (limit == RLIM_INFINITY)
return true;
 
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index d713184..3807014 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -1,6 +1,7 @@
 #ifndef __PERF_DSO
 #define __PERF_DSO
 
+#include sys/resource.h
 #include linux/types.h
 #include linux/rbtree.h
 #include stdbool.h
@@ -8,6 +9,8 @@
 #include map.h
 #include build-id.h
 
+extern rlim_t test_dso_data__fd_limit;
+
 enum dso_binary_type {
DSO_BINARY_TYPE__KALLSYMS = 0,
DSO_BINARY_TYPE__GUEST_KALLSYMS,
-- 
1.8.3.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/