AC_MSG_CHECKING([whether enlightenment quick initialization is enabled])
AC_MSG_RESULT([${quick_init}])
+function_trace=no
+AC_ARG_ENABLE([function-trace],
+ AS_HELP_STRING([--enable-function-trace],[]),
+ [
+ function_trace=yes
+ AC_DEFINE_UNQUOTED([ENABLE_FUNCTION_TRACE], [1], [enable function trace])
+ ],
+ [function_trace=no])
+AC_MSG_CHECKING([whether enlightenment function trace is enabled])
+AC_MSG_RESULT([${function_trace}])
+
e_requires="\
evas >= $efl_version \
ecore >= $efl_version \
#define ERR(...) EINA_LOG_DOM_ERR(e_log_dom, __VA_ARGS__)
#define CRI(...) EINA_LOG_DOM_CRIT(e_log_dom, __VA_ARGS__)
+#undef PRCTL
+#undef PRCTL_BACKTRACE
+#undef DLOG_BACKTRACE
+
+#ifdef ENABLE_FUNCTION_TRACE
+# include <sys/prctl.h>
+# undef PR_TASK_PERF_USER_TRACE
+# define PR_TASK_PERF_USER_TRACE 666
+# define PRCTL(str, x...) \
+ ({ \
+ char __buf__[256]; \
+ snprintf(__buf__, sizeof(__buf__), str, ##x); \
+ prctl(PR_TASK_PERF_USER_TRACE, __buf__, strlen(__buf__)); \
+ })
+
+# include <execinfo.h>
+# define PRCTL_BACKTRACE() \
+ ({ \
+ void *__buf__[256]; \
+ char **__strings__; \
+ int __nptrs__, i; \
+ __nptrs__ = backtrace(__buf__, 256); \
+ __strings__ = backtrace_symbols(__buf__, __nptrs__); \
+ if (__strings__) \
+ { \
+ for(i = 0 ; i < __nptrs__ ; ++i) \
+ PRCTL("%s", __strings__[i]); \
+ free(__strings__); \
+ } \
+})
+
+# ifdef HAVE_DLOG
+# define DLOG_BACKTRACE() \
+ ({ \
+ void *__buf__[256]; \
+ char **__strings__; \
+ int __nptrs__, i; \
+ __nptrs__ = backtrace(__buf__, 256); \
+ __strings__ = backtrace_symbols(__buf__, __nptrs__); \
+ if (__strings__) \
+ { \
+ for(i = 0 ; i < __nptrs__ ; ++i) \
+ dlog_print(DLOG_ERROR, LOG_TAG, "%s", __strings__[i]); \
+ free(__strings__); \
+ } \
+})
+# endif
+#else
+# define PRCTL
+# define PRCTL_BACKTRACE
+# define DLOG_BACKTRACE
+#endif
+
#define ELOG(t, cp, ec) \
do \
{ \
#define CRI(...) do { printf(__VA_ARGS__); putc('\n', stdout); } while(0)
#define ELOG(...) ;
#define ELOGF(...) ;
+
+#undef PRCTL
+#undef PRCTL_BACKTRACE
+#undef DLOG_BACKTRACE
+#define PRCTL
+#define PRCTL_BACKTRACE
+#define DLOG_BACKTRACE
#endif
#endif