summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/oprofile
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:14:24 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:29:45 +0100
commit29d6678fd546377459ef75cf54abeef5b969b5cf (patch)
tree8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-kernel/oprofile
parentda49de6885ee1bc424e70bc02f21f6ab920efb55 (diff)
downloadpoky-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-kernel/oprofile')
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/acinclude.m4600
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/opstart.patch235
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/xml_callgraph_details.patch232
-rw-r--r--meta/recipes-kernel/oprofile/oprofile_0.9.6.bb31
-rw-r--r--meta/recipes-kernel/oprofile/oprofile_cvs.bb27
-rw-r--r--meta/recipes-kernel/oprofile/oprofileui-svn.inc8
-rw-r--r--meta/recipes-kernel/oprofile/oprofileui.inc22
-rw-r--r--meta/recipes-kernel/oprofile/oprofileui_svn.bb2
8 files changed, 1157 insertions, 0 deletions
diff --git a/meta/recipes-kernel/oprofile/oprofile/acinclude.m4 b/meta/recipes-kernel/oprofile/oprofile/acinclude.m4
new file mode 100644
index 0000000000..ffaa8288df
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/acinclude.m4
@@ -0,0 +1,600 @@
1dnl AX_KERNEL_OPTION(option, action-if-found, action-if-not-found)
2dnl see if autoconf.h defines the option
3AC_DEFUN([AX_KERNEL_OPTION], [
4SAVE_CFLAGS=$CFLAGS
5CFLAGS="-I$KINC -O2 -D__KERNEL__"
6AC_TRY_COMPILE( [#include <linux/config.h>],
7[
8#ifndef $1
9break_me_hard(\\\);
10#endif
11],[$2],[$3],)
12CFLAGS=$SAVE_CFLAGS
13])
14
15dnl Handle the 2.4 module inside module/
16AC_DEFUN([AX_CONFIG_MODULE],
17[
18if test ! -f $KINC/linux/autoconf.h; then
19 AC_MSG_ERROR([no suitably configured kernel include tree found])
20fi
21
22dnl --- Get Linux kernel version and compile parameters ---
23
24AC_SUBST(KVERS)
25AC_MSG_CHECKING([for kernel version])
26dnl it's like this to handle mandrake's fubar version.h - bug #471448
27eval KVERS=`gcc -I$KINC -E -dM $KINC/linux/version.h | grep -w UTS_RELEASE | awk '{print $[]3}'`
28AC_MSG_RESULT([$KVERS])
29case "$KVERS" in
302.2.*|2.4.*) ;;
31*) AC_MSG_ERROR([Unsupported kernel version])
32esac
33
34dnl Check for the minimal kernel version supported
35AC_MSG_CHECKING([kernel version])
36AX_KERNEL_VERSION(2, 2, 10, <=, AC_MSG_RESULT([ok]), AC_MSG_ERROR([check html documentation install section]))
37
38dnl linux/spinlock.h added at some point in past
39AC_MSG_CHECKING([for $KINC/linux/spinlock.h])
40if test -f $KINC/linux/spinlock.h; then
41 EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DHAVE_LINUX_SPINLOCK_HEADER"
42 AC_MSG_RESULT([yes])
43else
44 AC_MSG_RESULT([no])
45fi
46
47AC_MSG_CHECKING([for rtc_lock])
48gcc -I$KINC -E $KINC/linux/mc146818rtc.h | grep rtc_lock >/dev/null
49if test "$?" -eq 0; then
50 EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DRTC_LOCK"
51 AC_MSG_RESULT([yes])
52else
53 AC_MSG_RESULT([no])
54fi
55
56arch="unknown"
57AC_MSG_CHECKING(for x86-64 architecture)
58AX_KERNEL_OPTION(CONFIG_X86_64, x8664=1, x8664=0)
59AX_MSG_RESULT_YN($x8664)
60BUILD_HAMMER=no
61if test "$x8664" -eq 1; then
62 arch="x86"
63 BUILD_HAMMER=yes
64else
65 AC_MSG_CHECKING(for x86 architecture)
66 AX_KERNEL_OPTION(CONFIG_X86, x86=1, x86=0)
67 AX_KERNEL_OPTION(CONFIG_X86_WP_WORKS_OK, x86=1, x86=$x86)
68 AX_MSG_RESULT_YN($x86)
69 test "$x86" = 1 && arch="x86"
70
71 if test "$arch" = "unknown"; then
72 AC_MSG_CHECKING(for ia64 architecture)
73 AX_KERNEL_OPTION(CONFIG_IA64, ia64=1, ia64=0)
74 AX_MSG_RESULT_YN($ia64)
75 test "$ia64" = 1 && arch="ia64"
76 fi
77
78fi
79AC_SUBST(BUILD_HAMMER)
80
81test "$arch" = "unknown" && AC_MSG_ERROR(Unsupported architecture)
82
83dnl check to see if kernel verion appropriate for arch
84AC_MSG_CHECKING(arch/kernel version combination)
85case "$arch" in
86ia64)
87 AX_KERNEL_VERSION(2, 4, 18, <, AC_MSG_RESULT([ok]),
88 AC_MSG_ERROR([unsupported arch/kernel])) ;;
89*) AC_MSG_RESULT([ok])
90esac
91
92dnl for now we do not support PREEMPT patch
93AC_MSG_CHECKING([for preempt patch])
94AX_KERNEL_OPTION(CONFIG_PREEMPT,preempt=1,preempt=0)
95AX_MSG_RESULT_YN([$preempt])
96test "$preempt" = 0 || AC_MSG_ERROR([unsupported kernel configuration : CONFIG_PREEMPT])
97
98AC_SUBST(KINC)
99
100MODINSTALLDIR=/lib/modules/$KVERS
101
102OPROFILE_MODULE_ARCH=$arch
103AC_SUBST(OPROFILE_MODULE_ARCH)
104]
105)
106
107dnl AX_KERNEL_VERSION(major, minor, level, comparison, action-if-true, action-if-false)
108AC_DEFUN([AX_KERNEL_VERSION], [
109SAVE_CFLAGS=$CFLAGS
110CFLAGS="-I$KINC -D__KERNEL__ -Werror"
111AC_TRY_COMPILE(
112 [
113 #include <linux/version.h>
114 #include <linux/config.h>
115 ],
116 [
117 #if LINUX_VERSION_CODE $4 KERNEL_VERSION($1, $2, $3)
118 break_me_hard(\\\);
119 #endif
120 ],
121[$5],[$6],)
122CFLAGS=$SAVE_CFLAGS
123])
124
125
126dnl AX_MSG_RESULT_YN(a)
127dnl results "yes" iff a==1, "no" else
128AC_DEFUN([AX_MSG_RESULT_YN], [x=no
129test "x$1" = "x1" && x=yes
130AC_MSG_RESULT($x)])
131
132dnl AX_MALLOC_ATTRIBUTE - see if gcc will take __attribute__((malloc))
133AC_DEFUN([AX_MALLOC_ATTRIBUTE],
134[
135AC_MSG_CHECKING([whether malloc attribute is understood])
136SAVE_CFLAGS=$CFLAGS
137CFLAGS="-Werror $CFLAGS"
138AC_TRY_COMPILE(,[
139void monkey() __attribute__((malloc));
140],AC_MSG_RESULT([yes]); AC_DEFINE(MALLOC_ATTRIBUTE_OK, 1, [whether malloc attribute is understood]), AC_MSG_RESULT([no]))
141CFLAGS=$SAVE_CFLAGS
142]
143)
144
145dnl builtin_expect is used in module we can't add that in config.h
146AC_DEFUN([AX_BUILTIN_EXPECT],
147[
148AC_MSG_CHECKING([whether __builtin_expect is understood])
149SAVE_CFLAGS=$CFLAGS
150CFLAGS="-Werror $CFLAGS"
151AC_TRY_LINK(,[
152int i;
153if (__builtin_expect(i, 0)) { }
154],
155AC_MSG_RESULT([yes]); EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DEXPECT_OK",
156AC_MSG_RESULT([no]);)
157CFLAGS=$SAVE_CFLAGS
158]
159)
160
161dnl AX_EXTRA_DIRS - Let user specify extra dirs for include/libs
162AC_DEFUN([AX_EXTRA_DIRS],
163[
164AC_ARG_WITH(extra-includes,
165[ --with-extra-includes=DIR add extra include paths],
166 use_extra_includes="$withval",
167 use_extra_includes=NO
168)
169if test -n "$use_extra_includes" && \
170 test "$use_extra_includes" != "NO"; then
171 ac_save_ifs=$IFS
172 IFS=':'
173 for dir in $use_extra_includes; do
174 extra_includes="$extra_includes -I$dir"
175 done
176 IFS=$ac_save_ifs
177 CPPFLAGS="$CPPFLAGS $extra_includes"
178fi
179
180AC_ARG_WITH(extra-libs,
181[ --with-extra-libs=DIR add extra library paths],
182 use_extra_libs=$withval,
183 use_extra_libs=NO
184)
185if test -n "$use_extra_libs" && \
186 test "$use_extra_libs" != "NO"; then
187 ac_save_ifs=$IFS
188 IFS=':'
189 for dir in $use_extra_libs; do
190 extra_libraries="$extra_libraries -L$dir"
191 done
192 IFS=$ac_save_ifs
193 LDFLAGS="$LDFLAGS $extra_libraries"
194fi
195]
196)
197
198dnl AX_POPT_CONST - check popt prototype
199AC_DEFUN([AX_POPT_CONST],
200[
201AC_MSG_CHECKING([popt prototype])
202SAVE_CXXFLAGS=$CXXFLAGS
203CXXFLAGS="-Werror $CXXFLAGS"
204AC_TRY_COMPILE([#include <popt.h>],
205[
206int c; char **v;
207poptGetContext(0, c, v, 0, 0);
208],
209AC_MSG_RESULT([takes char **]);,
210AC_MSG_RESULT([takes const char **]); AC_DEFINE(CONST_POPT, 1, [whether popt prototype takes a const char **]))
211CXXFLAGS="$SAVE_CXXFLAGS"
212]
213)
214
215dnl AX_CHECK_SSTREAM - check if local sstream is needed to compile OK
216AC_DEFUN([AX_CHECK_SSTREAM],
217[
218AC_MSG_CHECKING([whether to use included sstream])
219AC_TRY_COMPILE([#include <sstream>], [],
220AC_MSG_RESULT([no]);,
221AC_MSG_RESULT([yes]); OP_CXXFLAGS="$OP_CXXFLAGS -I\${top_srcdir}/include")
222]
223)
224
225dnl AX_CHECK_TYPEDEF(typedef_name, type, action-if-true, action-if-false)
226dnl exec action-if-true if typedef_name is a typedef to type else exec
227dnl action-if-false
228dnl currently work only with type typedef'ed in stddef.h
229AC_DEFUN([AX_CHECK_TYPEDEF], [
230dnl AC_LANG_PUSH(C) not in autoconf 2.13
231AC_LANG_SAVE
232AC_LANG_C
233SAVE_CFLAGS=$CFLAGS
234CFLAGS="-Werror $CFLAGS"
235
236AC_TRY_COMPILE(
237 [
238 #include <stddef.h>
239 ],
240 [
241 typedef void (*fct1)($1);
242 typedef void (*fct2)($2);
243 fct1 f1 = 0;
244 fct2 f2 = 0;
245 if (f1 == f2) {}
246 ],
247[$3],[$4])
248
249CFLAGS=$SAVE_CFLAGS
250AC_LANG_RESTORE
251])
252
253
254dnl AX_TYPEDEFED_NAME(typedef_name, candidate_list, var_name)
255dnl set var_name to the typedef name of $1 which must be in canditate_list
256dnl else produce a fatal error
257AC_DEFUN([AX_TYPEDEFED_NAME], [
258 AC_MSG_CHECKING([type of $1])
259 for f in $2; do
260 AX_CHECK_TYPEDEF($1, $f, $3="$f", $3="")
261 if test -n "${$3}"; then
262 break
263 fi
264 done
265 if test -n "${$3}"; then
266 AC_MSG_RESULT([${$3}])
267 else
268 AC_MSG_ERROR([not found])
269 fi
270])
271
272dnl find a binary in the path
273AC_DEFUN([QT_FIND_PATH],
274[
275 AC_MSG_CHECKING([for $1])
276 AC_CACHE_VAL(qt_cv_path_$1,
277 [
278 qt_cv_path_$1="NONE"
279 if test -n "$$2"; then
280 qt_cv_path_$1="$$2";
281 else
282 dirs="$3"
283 qt_save_IFS=$IFS
284 IFS=':'
285 for dir in $PATH; do
286 dirs="$dirs $dir"
287 done
288 IFS=$qt_save_IFS
289
290 for dir in $dirs; do
291 if test -x "$dir/$1"; then
292 if test -n "$5"; then
293 evalstr="$dir/$1 $5 2>&1 "
294 if eval $evalstr; then
295 qt_cv_path_$1="$dir/$1"
296 break
297 fi
298 else
299 qt_cv_path_$1="$dir/$1"
300 break
301 fi
302 fi
303 done
304 fi
305 ])
306
307 if test -z "$qt_cv_path_$1" || test "$qt_cv_path_$1" = "NONE"; then
308 AC_MSG_RESULT(not found)
309 $4
310 else
311 AC_MSG_RESULT($qt_cv_path_$1)
312 $2=$qt_cv_path_$1
313 fi
314])
315
316dnl Find the uic compiler on the path or in qt_cv_dir
317AC_DEFUN([QT_FIND_UIC],
318[
319 QT_FIND_PATH(uic, ac_uic, $qt_cv_dir/bin)
320 if test -z "$ac_uic" -a "$FATAL" = 1; then
321 AC_MSG_ERROR([uic binary not found in \$PATH or $qt_cv_dir/bin !])
322 fi
323])
324
325dnl Find the right moc in path/qt_cv_dir
326AC_DEFUN([QT_FIND_MOC],
327[
328 QT_FIND_PATH(moc2, ac_moc2, $qt_cv_dir/bin)
329 QT_FIND_PATH(moc, ac_moc1, $qt_cv_dir/bin)
330
331 if test -n "$ac_moc1" -a -n "$ac_moc2"; then
332 dnl found both. Prefer Qt3's if it exists else moc2
333 $ac_moc1 -v 2>&1 | grep "Qt 3" >/dev/null
334 if test "$?" = 0; then
335 ac_moc=$ac_moc1;
336 else
337 ac_moc=$ac_moc2;
338 fi
339 else
340 if test -n "$ac_moc1"; then
341 ac_moc=$ac_moc1;
342 else
343 ac_moc=$ac_moc2;
344 fi
345 fi
346
347 if test -z "$ac_moc" -a "$FATAL" = 1; then
348 AC_MSG_ERROR([moc binary not found in \$PATH or $qt_cv_dir/bin !])
349 fi
350])
351
352dnl check a particular libname
353AC_DEFUN([QT_TRY_LINK],
354[
355 SAVE_LIBS="$LIBS"
356 LIBS="$LIBS $1"
357 AC_TRY_LINK([
358 #include <qglobal.h>
359 #include <qstring.h>
360 ],
361 [
362 QString s("mangle_failure");
363 #if (QT_VERSION < 221)
364 break_me_(\\\);
365 #endif
366 ],
367 qt_cv_libname=$1,
368 )
369 LIBS="$SAVE_LIBS"
370])
371
372dnl check we can do a compile
373AC_DEFUN([QT_CHECK_COMPILE],
374[
375 AC_MSG_CHECKING([for Qt library name])
376
377 AC_CACHE_VAL(qt_cv_libname,
378 [
379 AC_LANG_CPLUSPLUS
380 SAVE_CXXFLAGS=$CXXFLAGS
381 CXXFLAGS="$CXXFLAGS $QT_INCLUDES $QT_LDFLAGS"
382
383 for libname in -lqt-mt -lqt3 -lqt2 -lqt;
384 do
385 QT_TRY_LINK($libname)
386 if test -n "$qt_cv_libname"; then
387 break;
388 fi
389 done
390
391 CXXFLAGS=$SAVE_CXXFLAGS
392 ])
393
394 if test -z "$qt_cv_libname"; then
395 AC_MSG_RESULT([failed])
396 if test "$FATAL" = 1 ; then
397 AC_MSG_ERROR([Cannot compile a simple Qt executable. Check you have the right \$QTDIR !])
398 fi
399 else
400 AC_MSG_RESULT([$qt_cv_libname])
401 fi
402])
403
404dnl get Qt version we're using
405AC_DEFUN([QT_GET_VERSION],
406[
407 AC_CACHE_CHECK([Qt version],lyx_cv_qtversion,
408 [
409 AC_LANG_CPLUSPLUS
410 SAVE_CPPFLAGS=$CPPFLAGS
411 CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
412
413 cat > conftest.$ac_ext <<EOF
414#line __oline__ "configure"
415#include "confdefs.h"
416#include <qglobal.h>
417"%%%"QT_VERSION_STR"%%%"
418EOF
419 lyx_cv_qtversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
420 grep '^"%%%"' 2>/dev/null | \
421 sed -e 's/"%%%"//g' -e 's/"//g'`
422 rm -f conftest.$ac_ext
423 CPPFLAGS=$SAVE_CPPFLAGS
424 ])
425
426 QT_VERSION=$lyx_cv_qtversion
427 AC_SUBST(QT_VERSION)
428])
429
430dnl start here
431AC_DEFUN([QT_DO_IT_ALL],
432[
433 dnl Please leave this alone. I use this file in
434 dnl oprofile.
435 FATAL=0
436
437 AC_ARG_WITH(qt-dir, [ --with-qt-dir where the root of Qt is installed ],
438 [ qt_cv_dir=`eval echo "$withval"/` ])
439
440 AC_ARG_WITH(qt-includes, [ --with-qt-includes where the Qt includes are. ],
441 [ qt_cv_includes=`eval echo "$withval"` ])
442
443 AC_ARG_WITH(qt-libraries, [ --with-qt-libraries where the Qt library is installed.],
444 [ qt_cv_libraries=`eval echo "$withval"` ])
445
446 dnl pay attention to $QTDIR unless overridden
447 if test -z "$qt_cv_dir"; then
448 qt_cv_dir=$QTDIR
449 fi
450
451 dnl derive inc/lib if needed
452 if test -n "$qt_cv_dir"; then
453 if test -z "$qt_cv_includes"; then
454 qt_cv_includes=$qt_cv_dir/include
455 fi
456 if test -z "$qt_cv_libraries"; then
457 qt_cv_libraries=$qt_cv_dir/lib
458 fi
459 fi
460
461 dnl flags for compilation
462 QT_INCLUDES=
463 QT_LDFLAGS=
464 if test -n "$qt_cv_includes"; then
465 QT_INCLUDES="-I$qt_cv_includes"
466 fi
467 if test -n "$qt_cv_libraries"; then
468 QT_LDFLAGS="-L$qt_cv_libraries"
469 fi
470 AC_SUBST(QT_INCLUDES)
471 AC_SUBST(QT_LDFLAGS)
472
473 QT_FIND_MOC
474 MOC=$ac_moc
475 AC_SUBST(MOC)
476 QT_FIND_UIC
477 UIC=$ac_uic
478 AC_SUBST(UIC)
479
480 QT_CHECK_COMPILE
481
482 QT_LIB=$qt_cv_libname;
483 AC_SUBST(QT_LIB)
484
485 if test -n "$qt_cv_libname"; then
486 QT_GET_VERSION
487 fi
488])
489
490dnl AX_CXXFLAGS_OPTIONS(var-name, option)
491dnl add option to var-name if $CXX support it.
492AC_DEFUN([AX_CHECK_PRECOMPILED_HEADER], [
493AC_MSG_CHECKING([whether ${CXX} support precompiled header])
494AC_LANG_SAVE
495AC_LANG_CPLUSPLUS
496SAVE_CXXFLAGS=$CXXFLAGS
497dnl we consider than if -Winvalid-pch is accepted pch will works ...
498CXXFLAGS=-Winvalid-pch
499dnl but we don't want -Winvalid-pch else compilation will fail due -Werror and
500dnl the fact than some pch will be invalid for the given compilation option
501AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} -include bits/stdc++.h", AC_MSG_RESULT([no]))
502CXXFLAGS=$SAVE_CXXFLAGS
503AC_LANG_RESTORE
504])
505
506dnl AX_CHECK_DOCBOOK
507AC_DEFUN([AX_CHECK_DOCBOOK], [
508# It's just rude to go over the net to build
509XSLTPROC_FLAGS=--nonet
510DOCBOOK_ROOT=
511if test ! -f /etc/xml/catalog; then
512 for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/;
513 do
514 if test -d "$i"; then
515 DOCBOOK_ROOT=$i
516 fi
517 done
518
519 # Last resort - try net
520 if test -z "$DOCBOOK_ROOT"; then
521 XSLTPROC_FLAGS=
522 fi
523else
524 XML_CATALOG=/etc/xml/catalog
525 CAT_ENTRY_START='<!--'
526 CAT_ENTRY_END='-->'
527fi
528
529AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,)
530XSLTPROC_WORKS=no
531if test -n "$XSLTPROC"; then
532 AC_MSG_CHECKING([whether xsltproc works])
533
534 if test -n "$XML_CATALOG"; then
535 DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
536 else
537 DB_FILE="$DOCBOOK_ROOT/docbook.xsl"
538 fi
539
540 $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END
541<?xml version="1.0" encoding='ISO-8859-1'?>
542<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
543<book id="test">
544</book>
545END
546 if test "$?" = 0; then
547 XSLTPROC_WORKS=yes
548 fi
549 AC_MSG_RESULT($XSLTPROC_WORKS)
550fi
551AM_CONDITIONAL(have_xsltproc, test "$XSLTPROC_WORKS" = "yes")
552
553AC_SUBST(XML_CATALOG)
554AC_SUBST(XSLTPROC_FLAGS)
555AC_SUBST(DOCBOOK_ROOT)
556AC_SUBST(CAT_ENTRY_START)
557AC_SUBST(CAT_ENTRY_END)
558])
559
560dnl AX_CFLAGS_OPTIONS(var-name, option)
561dnl add option to var-name if $CC support it.
562AC_DEFUN([AX_CFLAGS_OPTION], [
563AC_MSG_CHECKING([whether ${CC} $2 is understood])
564AC_LANG_SAVE
565AC_LANG_C
566SAVE_CFLAGS=$CFLAGS
567CFLAGS=$2
568AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
569CFLAGS=$SAVE_CFLAGS
570AC_LANG_RESTORE
571])
572
573
574dnl AX_CXXFLAGS_OPTIONS(var-name, option)
575dnl add option to var-name if $CXX support it.
576AC_DEFUN([AX_CXXFLAGS_OPTION], [
577AC_MSG_CHECKING([whether ${CXX} $2 is understood])
578AC_LANG_SAVE
579AC_LANG_CPLUSPLUS
580SAVE_CXXFLAGS=$CXXFLAGS
581CXXFLAGS=$2
582AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
583CXXFLAGS=$SAVE_CXXFLAGS
584AC_LANG_RESTORE
585])
586
587dnl AX_COPY_IF_CHANGE(source, dest)
588dnl copy source to dest if they don't compare equally or if dest doesn't exist
589AC_DEFUN([AX_COPY_IF_CHANGE], [
590if test -r $2; then
591 if cmp $1 $2 > /dev/null; then
592 echo $2 is unchanged
593 else
594 cp -f $1 $2
595 fi
596else
597 cp -f $1 $2
598fi
599])
600
diff --git a/meta/recipes-kernel/oprofile/oprofile/opstart.patch b/meta/recipes-kernel/oprofile/oprofile/opstart.patch
new file mode 100644
index 0000000000..d61c30095f
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/opstart.patch
@@ -0,0 +1,235 @@
1Index: oprofile/utils/Makefile.am
2===================================================================
3--- oprofile.orig/utils/Makefile.am 2005-03-31 18:20:41.000000000 +0100
4+++ oprofile/utils/Makefile.am 2008-07-02 15:14:07.000000000 +0100
5@@ -3,8 +3,15 @@
6
7 LIBS=@POPT_LIBS@ @LIBERTY_LIBS@
8
9-bin_PROGRAMS = ophelp
10+bin_PROGRAMS = ophelp opstart
11 dist_bin_SCRIPTS = opcontrol
12
13 ophelp_SOURCES = ophelp.c
14 ophelp_LDADD = ../libop/libop.a ../libutil/libutil.a
15+
16+opstart_SOURCES = opstart.c
17+
18+install-exec-local:
19+ cd $(DESTDIR)/$(bindir) && \
20+ rm -f opstop && \
21+ $(LN_S) opstart opstop
22Index: oprofile/utils/opstart.c
23===================================================================
24--- /dev/null 1970-01-01 00:00:00.000000000 +0000
25+++ oprofile/utils/opstart.c 2008-07-02 15:14:07.000000000 +0100
26@@ -0,0 +1,110 @@
27+/**
28+ * @file opstart.c
29+ * Start/Stop oprofile
30+ *
31+ * @remark Copyright 2007 Openedhand Ltd.
32+ * @remark Read the file COPYING
33+ *
34+ * @author Richard Purdie
35+ */
36+
37+#include <signal.h>
38+#include <stdio.h>
39+#include <stdlib.h>
40+#include <string.h>
41+#include <unistd.h>
42+#include <sys/types.h>
43+#include <sys/stat.h>
44+
45+int main(const int argc, const char* argv[])
46+{
47+ const char *enable = "/dev/oprofile/enable";
48+ const char *lockfile;
49+ unsigned long dpid;
50+ struct stat sbuf;
51+ FILE *lfile, *efile;
52+ int sig, enb, err;
53+
54+ if (argc >= 2) {
55+ printf("Error: Invalid options.\n");
56+ return 1;
57+ }
58+
59+ lockfile = getenv("LOCK_FILE");
60+ if (!lockfile)
61+ lockfile = "/var/lib/oprofile/lock";
62+
63+ /* Add SESSION_DIR support? */
64+
65+ if (geteuid()) {
66+ printf("Error: This program must be run as root.\n");
67+ return 1;
68+ }
69+
70+ if (stat(enable, &sbuf)) {
71+ printf("Error: Could not find /dev/oprofile/enable, the"
72+ " kernel module probably isn't loaded.\n");
73+ printf("This binary only works with 2.6 kernels and oprofile"
74+ " must have been initialised with 'opcontrol --start-daemon'.\n");
75+ return 1;
76+ }
77+
78+ if (stat(lockfile, &sbuf)) {
79+ printf("Error: Could not find lockfile %s.\n", lockfile);
80+ printf("The oprofile daemon must be running (oprofile must"
81+ " have been initialised with 'opcontrol --start-daemon').\n");
82+ return 1;
83+ }
84+
85+ lfile = fopen(lockfile, "r");
86+ if (!lfile) {
87+ printf("Error opening lockfile %s.\n", lockfile);
88+ return 1;
89+ }
90+
91+ err = fscanf(lfile, "%lud", (unsigned long *) &dpid);
92+ if (err != 1) {
93+ printf("Error reading pid from lockfile %s.\n", lockfile);
94+ return 1;
95+ }
96+ fclose(lfile);
97+
98+ efile = fopen(enable, "r");
99+ if (!efile) {
100+ printf("Error opening %s.\n", enable);
101+ return 1;
102+ }
103+
104+ if (strstr(argv[0], "opstart")) {
105+ printf("Starting Profiler\n");
106+ sig = SIGUSR1;
107+ enb = 1;
108+ } else if (strstr(argv[0], "opstop")) {
109+ printf("Stopping Oprofile.\n");
110+ printf("You need to run 'opcontrol --dump' when the session"
111+ " is finished.\n");
112+ sig = SIGUSR2;
113+ enb = 0;
114+ } else {
115+ printf("Error: Please call as 'opstart' or 'opstop'\n");
116+ return 1;
117+ }
118+
119+ err = kill(dpid, 0);
120+ if (err) {
121+ printf("Error sending signal to oprofiled. Stale lockfile"
122+ " (%s) ?\n", lockfile);
123+ return 1;
124+ }
125+
126+ fprintf(efile, "%d\n", enb);
127+ err = kill(dpid, sig);
128+ if (err) {
129+ printf("Error sending signal to oprofiled. Stale lockfile"
130+ " (%s) ?\n", lockfile);
131+ return 1;
132+ }
133+
134+ return 0;
135+}
136+
137Index: oprofile/configure.in
138===================================================================
139--- oprofile.orig/configure.in 2008-07-02 15:13:58.000000000 +0100
140+++ oprofile/configure.in 2008-07-02 15:17:37.000000000 +0100
141@@ -16,6 +16,7 @@
142 AM_CONFIG_HEADER(config.h)
143
144 AC_PROG_RANLIB
145+AC_PROG_LN_S
146 AC_PROG_LIBTOOL
147
148 dnl for the man page
149@@ -241,6 +242,8 @@
150 doc/xsl/catalog-1.xml \
151 doc/oprofile.1 \
152 doc/opcontrol.1 \
153+ doc/opstart.1 \
154+ doc/opstop.1 \
155 doc/ophelp.1 \
156 doc/opreport.1 \
157 doc/opannotate.1 \
158Index: oprofile/doc/Makefile.am
159===================================================================
160--- oprofile.orig/doc/Makefile.am 2008-07-02 15:13:59.000000000 +0100
161+++ oprofile/doc/Makefile.am 2008-07-02 15:14:07.000000000 +0100
162@@ -11,6 +11,8 @@
163 man_MANS = \
164 oprofile.1 \
165 opcontrol.1 \
166+ opstart.1 \
167+ opstop.1 \
168 opreport.1 \
169 opannotate.1 \
170 opgprof.1 \
171Index: oprofile/doc/opstart.1.in
172===================================================================
173--- /dev/null 1970-01-01 00:00:00.000000000 +0000
174+++ oprofile/doc/opstart.1.in 2008-07-02 15:14:07.000000000 +0100
175@@ -0,0 +1,27 @@
176+.TH OPSTART 1 "@DATE@" "oprofile @VERSION@"
177+.UC 4
178+.SH NAME
179+opstart \- start OProfile profiling
180+.SH SYNOPSIS
181+.br
182+.B opstart
183+.SH DESCRIPTION
184+.B opstart
185+is a simple optimised command to start profiling with 2.6 Linux kernels.
186+OProfile should have already been initialised by calling "opcontrol --start-daemon".
187+
188+.SH ENVIRONMENT
189+No special environment variables are recognised by opstart.
190+
191+.SH FILES
192+.TP
193+.I /var/lib/oprofile/samples/
194+The location of the generated sample files.
195+
196+.SH VERSION
197+.TP
198+This man page is current for @PACKAGE@-@VERSION@.
199+
200+.SH SEE ALSO
201+.BR @OP_DOCDIR@,
202+.BR oprofile(1)
203Index: oprofile/doc/opstop.1.in
204===================================================================
205--- /dev/null 1970-01-01 00:00:00.000000000 +0000
206+++ oprofile/doc/opstop.1.in 2008-07-02 15:14:07.000000000 +0100
207@@ -0,0 +1,28 @@
208+.TH OPSTOP 1 "@DATE@" "oprofile @VERSION@"
209+.UC 4
210+.SH NAME
211+opstop \- stop OProfile profiling
212+.SH SYNOPSIS
213+.br
214+.B opstop
215+.SH DESCRIPTION
216+.B opstop
217+is a simple optimsed command to stop profiling with 2.6 Linux kernels.
218+You need to run "opcontrol --dump" before being able to view a profile
219+with opreport.
220+
221+.SH ENVIRONMENT
222+No special environment variables are recognised by opstop.
223+
224+.SH FILES
225+.TP
226+.I /var/lib/oprofile/samples/
227+The location of the generated sample files.
228+
229+.SH VERSION
230+.TP
231+This man page is current for @PACKAGE@-@VERSION@.
232+
233+.SH SEE ALSO
234+.BR @OP_DOCDIR@,
235+.BR oprofile(1)
diff --git a/meta/recipes-kernel/oprofile/oprofile/xml_callgraph_details.patch b/meta/recipes-kernel/oprofile/oprofile/xml_callgraph_details.patch
new file mode 100644
index 0000000000..e5ab3d916e
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/xml_callgraph_details.patch
@@ -0,0 +1,232 @@
1Work in Progress- This patch breaks output_symbol_bytes
2---
3 ChangeLog | 9 +++++++++
4 libpp/callgraph_container.cpp | 10 ++++++++--
5 libpp/callgraph_container.h | 14 ++++++++++----
6 libpp/format_output.cpp | 30 +++++++++++++++++++++++++-----
7 libpp/format_output.h | 6 +++---
8 pp/opreport.cpp | 5 +++--
9 pp/opreport_options.cpp | 4 ++--
10 7 files changed, 60 insertions(+), 18 deletions(-)
11
12Index: oprofile1/pp/opreport.cpp
13===================================================================
14--- oprofile1.orig/pp/opreport.cpp 2007-05-24 15:32:20.000000000 +0100
15+++ oprofile1/pp/opreport.cpp 2007-05-24 20:07:14.000000000 +0100
16@@ -555,10 +555,11 @@ int opreport(options::spec const & spec)
17
18 output_diff_symbols(pc1, pc2, multiple_apps);
19 } else if (options::callgraph) {
20- callgraph_container cg_container;
21+ callgraph_container cg_container(options::debug_info,
22+ options::details);
23 cg_container.populate(options::archive_path, iprofiles,
24 options::extra_found_images,
25- options::debug_info, options::threshold,
26+ options::threshold,
27 options::merge_by.lib, options::symbol_filter);
28
29 output_cg_symbols(cg_container, multiple_apps);
30Index: oprofile1/ChangeLog
31===================================================================
32--- oprofile1.orig/ChangeLog 2007-05-24 18:30:47.000000000 +0100
33+++ oprofile1/ChangeLog 2007-05-24 20:07:14.000000000 +0100
34@@ -1,5 +1,14 @@
35 2007-05-24 Richard Purdie <rpurdie@openedhand.com>
36
37+ * libpp/callgraph_container.cpp:
38+ * libpp/callgraph_container.h:
39+ * libpp/format_output.cpp:
40+ * libpp/format_output.h:
41+ * pp/opreport.cpp:
42+ * pp/opreport_options.cpp: Add callgraph XML detail support
43+
44+2007-05-24 Richard Purdie <rpurdie@openedhand.com>
45+
46 * events/arm/xscale1/events:
47 * events/arm/xscale2/events: Add extra Xscale PMU event definitions
48
49Index: oprofile1/libpp/callgraph_container.cpp
50===================================================================
51--- oprofile1.orig/libpp/callgraph_container.cpp 2007-05-24 15:32:20.000000000 +0100
52+++ oprofile1/libpp/callgraph_container.cpp 2007-05-24 20:07:14.000000000 +0100
53@@ -391,15 +391,21 @@ const symbol_collection & arc_recorder::
54 return cg_syms;
55 }
56
57+callgraph_container::callgraph_container(bool debug_info, bool need_details)
58+ :
59+ pc(debug_info, need_details),
60+ debug_info(debug_info)
61+{
62+}
63+
64
65 void callgraph_container::populate(string const & archive_path,
66 list<inverted_profile> const & iprofiles,
67- extra_images const & extra, bool debug_info, double threshold,
68+ extra_images const & extra, double threshold,
69 bool merge_lib, string_filter const & sym_filter)
70 {
71 // non callgraph samples container, we record sample at symbol level
72 // not at vma level.
73- profile_container pc(debug_info, false);
74
75 list<inverted_profile>::const_iterator it;
76 list<inverted_profile>::const_iterator const end = iprofiles.end();
77Index: oprofile1/libpp/callgraph_container.h
78===================================================================
79--- oprofile1.orig/libpp/callgraph_container.h 2007-05-24 15:32:20.000000000 +0100
80+++ oprofile1/libpp/callgraph_container.h 2007-05-24 20:07:14.000000000 +0100
81@@ -19,8 +19,8 @@
82 #include "symbol.h"
83 #include "symbol_functors.h"
84 #include "string_filter.h"
85+#include "profile_container.h"
86
87-class profile_container;
88 class inverted_profile;
89 class profile_t;
90 class extra_images;
91@@ -103,6 +103,8 @@ private:
92 */
93 class callgraph_container {
94 public:
95+ callgraph_container(bool debug_info, bool need_details);
96+
97 /**
98 * Populate the container, must be called once only.
99 * @param archive_path oparchive prefix path
100@@ -118,9 +120,8 @@ public:
101 */
102 void populate(std::string const & archive_path,
103 std::list<inverted_profile> const & iprofiles,
104- extra_images const & extra, bool debug_info,
105- double threshold, bool merge_lib,
106- string_filter const & sym_filter);
107+ extra_images const & extra, double threshold,
108+ bool merge_lib, string_filter const & sym_filter);
109
110 /// return hint on how data must be displayed.
111 column_flags output_hint() const;
112@@ -131,6 +132,9 @@ public:
113 // return all the cg symbols
114 const symbol_collection & get_symbols() const;
115
116+ // profile container callgraph is based on
117+ profile_container pc;
118+
119 private:
120 /**
121 * Record caller/callee for one cg file
122@@ -162,6 +166,8 @@ private:
123 profile_container const & pc, bool debug_info,
124 bool merge_lib);
125
126+ bool debug_info;
127+
128 /// record all main symbols
129 void add_symbols(profile_container const & pc);
130
131Index: oprofile1/pp/opreport_options.cpp
132===================================================================
133--- oprofile1.orig/pp/opreport_options.cpp 2007-05-24 15:32:20.000000000 +0100
134+++ oprofile1/pp/opreport_options.cpp 2007-05-24 20:07:14.000000000 +0100
135@@ -165,8 +165,8 @@ void check_options(bool diff)
136
137 if (callgraph) {
138 symbols = true;
139- if (details) {
140- cerr << "--callgraph is incompatible with --details" << endl;
141+ if (details && !xml) {
142+ cerr << "--callgraph is incompatible with --details without --xml" << endl;
143 do_exit = true;
144 }
145
146Index: oprofile1/libpp/format_output.cpp
147===================================================================
148--- oprofile1.orig/libpp/format_output.cpp 2007-05-24 15:32:20.000000000 +0100
149+++ oprofile1/libpp/format_output.cpp 2007-05-24 20:07:14.000000000 +0100
150@@ -594,9 +594,9 @@ xml_formatter::
151 xml_formatter(profile_container const * p,
152 symbol_collection & s)
153 :
154+ need_details(false),
155 profile(p),
156- symbols(s),
157- need_details(false)
158+ symbols(s)
159 {
160 if (profile)
161 counts.total = profile->samples_count();
162@@ -673,8 +673,8 @@ void xml_formatter::output_symbol_data(o
163 if (name.size() > 0 && name[0] != '?') {
164 output_attribute(out, datum, ff_vma, STARTING_ADDR);
165
166- if (need_details)
167- xml_support->output_symbol_bytes(bytes_out, symb, sd_it->second);
168+ //if (need_details)
169+ // xml_support->output_symbol_bytes(bytes_out, symb, sd_it->second);
170 }
171 out << close_element();
172
173@@ -843,7 +843,7 @@ output_attribute(ostream & out, field_da
174 xml_cg_formatter::
175 xml_cg_formatter(callgraph_container const * cg, symbol_collection & s)
176 :
177- xml_formatter(0, s),
178+ xml_formatter(&cg->pc, s),
179 callgraph(cg)
180 {
181 counts.total = callgraph->samples_count();
182@@ -946,6 +946,26 @@ output_symbol(ostream & out,
183
184 out << init_attr(ID_REF, indx);
185
186+ if (need_details) {
187+ ostringstream details;
188+ symbol_details_t & sd = symbol_details[indx];
189+ size_t const detail_lo = sd.index;
190+
191+ string detail_str = output_symbol_details(symb, sd.index, lo, hi);
192+
193+ if (detail_str.size() > 0) {
194+ if (sd.id < 0)
195+ sd.id = indx;
196+ details << detail_str;
197+ }
198+
199+ if (sd.index > detail_lo) {
200+ sd.details = sd.details + details.str();
201+ out << init_attr(DETAIL_LO, detail_lo);
202+ out << init_attr(DETAIL_HI, sd.index-1);
203+ }
204+ }
205+
206 out << close_element(NONE, true);
207
208 out << open_element(CALLERS);
209Index: oprofile1/libpp/format_output.h
210===================================================================
211--- oprofile1.orig/libpp/format_output.h 2007-05-24 15:32:20.000000000 +0100
212+++ oprofile1/libpp/format_output.h 2007-05-24 20:07:14.000000000 +0100
213@@ -249,6 +249,9 @@ public:
214 // output SymbolData XML elements
215 void output_symbol_data(std::ostream & out);
216
217+ /// true if we need to show details for each symbols
218+ bool need_details;
219+
220 private:
221 /// container we work from
222 profile_container const * profile;
223@@ -256,9 +259,6 @@ private:
224 // ordered collection of symbols associated with this profile
225 symbol_collection & symbols;
226
227- /// true if we need to show details for each symbols
228- bool need_details;
229-
230 // count of DetailData items output so far
231 size_t detail_count;
232
diff --git a/meta/recipes-kernel/oprofile/oprofile_0.9.6.bb b/meta/recipes-kernel/oprofile/oprofile_0.9.6.bb
new file mode 100644
index 0000000000..9679411bec
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile_0.9.6.bb
@@ -0,0 +1,31 @@
1DESCRIPTION = "OProfile is a system-wide profiler for Linux systems, capable \
2of profiling all running code at low overhead."
3HOMEPAGE = "http://oprofile.sourceforge.net/news/"
4BUGTRACKER = "http://sourceforge.net/tracker/?group_id=16191&atid=116191"
5
6LICENSE = "LGPLv2.1+ & GPLv2"
7LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
8 file://libopagent/opagent.h;beginline=5;endline=26;md5=4f16f72c7a493d8a4704aa18d03d15c6 \
9 file://daemon/liblegacy/p_module.h;beginline=2;endline=20;md5=fc23a43455edf185307274a99730b6e4"
10
11SECTION = "devel"
12
13DEPENDS = "popt binutils"
14RDEPENDS = "binutils-symlinks"
15RRECOMMENDS = "kernel-vmlinux"
16
17PR = "r0"
18
19SRC_URI = "${SOURCEFORGE_MIRROR}/oprofile/oprofile-${PV}.tar.gz \
20 file://opstart.patch \
21 file://acinclude.m4"
22S = "${WORKDIR}/oprofile-${PV}"
23
24inherit autotools
25
26EXTRA_OECONF = "--with-kernel-support --without-x"
27
28do_configure () {
29 cp ${WORKDIR}/acinclude.m4 ${S}/
30 autotools_do_configure
31}
diff --git a/meta/recipes-kernel/oprofile/oprofile_cvs.bb b/meta/recipes-kernel/oprofile/oprofile_cvs.bb
new file mode 100644
index 0000000000..dd8dd58863
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile_cvs.bb
@@ -0,0 +1,27 @@
1PV = "0.9.4+cvs${SRCDATE}"
2PR = "r0"
3SECTION = "devel"
4DESCRIPTION = "OProfile is a system-wide profiler for Linux systems, capable \
5of profiling all running code at low overhead."
6LICENSE = "GPL"
7DEPENDS = "popt binutils"
8RDEPENDS = "binutils-symlinks"
9RRECOMMENDS = "kernel-vmlinux"
10
11DEFAULT_PREFERENCE = "-1"
12
13SRC_URI = "cvs://anonymous@oprofile.cvs.sourceforge.net/cvsroot/oprofile;module=oprofile \
14 file://opstart.patch;patch=1 \
15 file://acinclude.m4"
16S = "${WORKDIR}/oprofile"
17
18inherit autotools
19
20EXTRA_OECONF = "--with-kernel-support \
21 --without-x \
22 --disable-werror "
23
24do_configure () {
25 cp ${WORKDIR}/acinclude.m4 ${S}/
26 autotools_do_configure
27}
diff --git a/meta/recipes-kernel/oprofile/oprofileui-svn.inc b/meta/recipes-kernel/oprofile/oprofileui-svn.inc
new file mode 100644
index 0000000000..4c9211cc05
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui-svn.inc
@@ -0,0 +1,8 @@
1require oprofileui.inc
2
3PV = "0.0+svnr${SRCREV}"
4PR = "r0"
5
6S = "${WORKDIR}/trunk"
7
8SRC_URI = "svn://svn.o-hand.com/repos/oprofileui;module=trunk;proto=http"
diff --git a/meta/recipes-kernel/oprofile/oprofileui.inc b/meta/recipes-kernel/oprofile/oprofileui.inc
new file mode 100644
index 0000000000..22b56a584f
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui.inc
@@ -0,0 +1,22 @@
1DESCRIPTION = "User interface for the OProfile tool"
2HOMEPAGE = "http://labs.o-hand.com/oprofileui/"
3BUGTRACKER = "http://bugzilla.o-hand.com/"
4
5SECTION = "x11"
6
7LICENSE = "GPLv2"
8LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
9
10DEPENDS = "glib-2.0 gtk+ libglade gnome-vfs libxml2 avahi gconf"
11
12inherit autotools pkgconfig gtk-icon-cache
13
14PACKAGES =+ "oprofileui-server oprofileui-viewer"
15
16EXTRA_OECONF = "--with-avahi"
17
18FILES_oprofileui-viewer = "${bindir}/oparchconv ${bindir}/oprofile-viewer ${datadir}/applications/ ${datadir}/oprofileui/"
19RDEPENDS_oprofile-viewer = "oprofile"
20
21FILES_oprofileui-server = "${bindir}/oprofile-server"
22RDEPENDS_oprofile-server = "oprofile"
diff --git a/meta/recipes-kernel/oprofile/oprofileui_svn.bb b/meta/recipes-kernel/oprofile/oprofileui_svn.bb
new file mode 100644
index 0000000000..39e10b4fd2
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui_svn.bb
@@ -0,0 +1,2 @@
1require oprofileui-svn.inc
2