[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110110160417.GB2685@psychotron.brq.redhat.com>
Date: Mon, 10 Jan 2011 17:04:18 +0100
From: Jiri Pirko <jpirko@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: a.p.zijlstra@...llo.nl, paulus@...ba.org, mingo@...e.hu,
acme@...stprotocols.net
Subject: [PATCH] tools/perf: use PTHREAD_STACK_MIN to avoid
pthread_attr_setstacksize() fail
on ppc64:
/usr/include/bits/local_lim.h:#define PTHREAD_STACK_MIN 131072
therefore following set of commands:
# perf sched record date
# perf sched report
gives:
perf.2.6.37test: builtin-sched.c:493: create_tasks: Assertion `!(err)' failed.
So make sure we do not set stack size lower than PTHREAD_STACK_MIN.
Signed-off-by: Jiri Pirko <jpirko@...hat.com>
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 7a4ebeb..bec0161 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -489,7 +489,8 @@ static void create_tasks(void)
err = pthread_attr_init(&attr);
BUG_ON(err);
- err = pthread_attr_setstacksize(&attr, (size_t)(16*1024));
+ err = pthread_attr_setstacksize(&attr,
+ (size_t) max(16 * 1024, PTHREAD_STACK_MIN));
BUG_ON(err);
err = pthread_mutex_lock(&start_work_mutex);
BUG_ON(err);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists