[lng-odp] Change in lng/odp[master]: linux-generic: add stacktrace

2016-07-07 Thread Maxim Uvarov (Code Review)
Maxim Uvarov has uploaded a new change for review.

  https://review.linaro.org/13134

Change subject: linux-generic: add stacktrace
..

linux-generic: add stacktrace

Add initial version for more verbose stacktrace for linux-
generic odp platform.
Usage:

export ODP_STACKTRACE_ENABLE=y

Thread 0 terminated with signal=11 (SIGSEGV)
./test/performance/odp_scheduling[0x4250b3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7f7ae5cc1330]
./test/performance/odp_scheduling[0x40a064]
./test/performance/odp_scheduling(main+0x2c1)[0x40a5dc]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f7ae590df45]
./test/performance/odp_scheduling[0x408ed9]
odp_stacktrace.c:57:fault_handler():Program interrupted
Aborted

Then convert address to function symbol with add2line:

addr2line  -e ./test/performance/odp_scheduling 0x4250b3
/opt/Linaro/odp3.git/platform/linux-generic/odp_stacktrace.c:49

Change-Id: Id9df73633583e93dc4fb39f0a90fdf6c7c56a6cc
Signed-off-by: Maxim Uvarov 
---
M platform/linux-generic/Makefile.am
M platform/linux-generic/include/odp_debug_internal.h
M platform/linux-generic/odp_init.c
A platform/linux-generic/odp_stacktrace.c
4 files changed, 81 insertions(+), 0 deletions(-)


  git pull ssh://review.linaro.org:29418/lng/odp refs/changes/34/13134/1

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index c8fd8cb..1a7be32 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -174,6 +174,7 @@
   odp_spinlock.c \
   odp_spinlock_recursive.c \
   odp_system_info.c \
+  odp_stacktrace.c \
   odp_thread.c \
   odp_thrmask.c \
   odp_ticketlock.c \
diff --git a/platform/linux-generic/include/odp_debug_internal.h 
b/platform/linux-generic/include/odp_debug_internal.h
index 02ae87a..a43705f 100644
--- a/platform/linux-generic/include/odp_debug_internal.h
+++ b/platform/linux-generic/include/odp_debug_internal.h
@@ -83,6 +83,8 @@
 #define ODP_PRINT(fmt, ...) \
odp_global_data.log_fn(ODP_LOG_PRINT, " " fmt, ##__VA_ARGS__)
 
+void _odp_stracktrace_init(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index f534759..875381f 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -33,6 +33,9 @@
odp_global_data.abort_fn = params->abort_fn;
}
 
+   if (getenv("ODP_STACKTRACE_ENABLE"))
+   _odp_stracktrace_init();
+
if (odp_cpumask_init_global(params)) {
ODP_ERR("ODP cpumask init failed.\n");
goto init_failed;
diff --git a/platform/linux-generic/odp_stacktrace.c 
b/platform/linux-generic/odp_stacktrace.c
new file mode 100644
index 000..76a8803
--- /dev/null
+++ b/platform/linux-generic/odp_stacktrace.c
@@ -0,0 +1,75 @@
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static odp_spinlock_t print_lock;
+
+static void fault_handler(int signal)
+{
+   size_t num_stack_frames;
+   const char  *signal_name;
+   void  *bt_array[4096];
+   sigset_t sigset;
+
+   /* disable all signals */
+   sigfillset();
+   sigprocmask(SIG_BLOCK, , NULL);
+
+   switch (signal) {
+   case SIGILL:
+   signal_name = "SIGILL";   break;
+   case SIGFPE:
+   signal_name = "SIGFPE";   break;
+   case SIGSEGV:
+   signal_name = "SIGSEGV";  break;
+   case SIGTERM:
+   signal_name = "SIGTERM";  break;
+   case SIGBUS:
+   signal_name = "SIGBUS";   break;
+   default:
+   signal_name = "UNKNOWN";  break;
+   }
+
+   odp_spinlock_lock(_lock);
+   num_stack_frames = backtrace(bt_array, 100);
+   fprintf(stderr, "\nThread %d terminated with signal=%u (%s)\n",
+   odp_thread_id(), signal, signal_name);
+   backtrace_symbols_fd(bt_array, num_stack_frames, fileno(stderr));
+   fflush(NULL);
+   sync();
+   odp_spinlock_unlock(_lock);
+
+   ODP_ABORT("Program interrupted\n");
+}
+
+void _odp_stracktrace_init(void)
+{
+   struct sigaction signal_action;
+
+   odp_spinlock_init(_lock);
+
+   memset(_action, 0, sizeof(signal_action));
+   signal_action.sa_handler = fault_handler;
+   sigfillset(_action.sa_mask);
+
+   sigaction(SIGILL,  _action, NULL);
+   sigaction(SIGFPE,  _action, NULL);
+   sigaction(SIGSEGV, _action, NULL);
+   sigaction(SIGTERM, _action, NULL);
+   sigaction(SIGBUS,  _action, NULL);
+}

-- 
To view, 

[lng-odp] Change in lng/odp[master]: validation: enable bt for scheduling test

2016-07-07 Thread Maxim Uvarov (Code Review)
Maxim Uvarov has uploaded a new change for review.

  https://review.linaro.org/13135

Change subject: validation: enable bt for scheduling test
..

validation: enable bt for scheduling test

Change-Id: I3479b518df39be9ee7beab1ebf98a64f9895457e
Signed-off-by: Maxim Uvarov 
---
M test/performance/odp_scheduling_run.sh
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://review.linaro.org:29418/lng/odp refs/changes/35/13135/1

diff --git a/test/performance/odp_scheduling_run.sh 
b/test/performance/odp_scheduling_run.sh
index 755b0c1..fd81d78 100755
--- a/test/performance/odp_scheduling_run.sh
+++ b/test/performance/odp_scheduling_run.sh
@@ -8,6 +8,7 @@
 # Script that passes command line arguments to odp_scheduling test when
 # launched by 'make check'
 
+export ODP_STACKTRACE_ENABLE=y
 TEST_DIR="${TEST_DIR:-$(dirname $0)}"
 ret=0
 

-- 
To view, visit https://review.linaro.org/13135
To unsubscribe, visit https://review.linaro.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3479b518df39be9ee7beab1ebf98a64f9895457e
Gerrit-PatchSet: 1
Gerrit-Project: lng/odp
Gerrit-Branch: master
Gerrit-Owner: Maxim Uvarov 


[lng-odp] Change in lng/odp[master]: validation: timer: don't access non-existing timers

2016-03-19 Thread Maxim Uvarov (Code Review)
Maxim Uvarov has uploaded a new change for review.

  https://review.linaro.org/10969

Change subject: validation: timer: don't access non-existing timers
..

validation: timer: don't access non-existing timers

Since e5c85d3f "validation: timer: handle early exhaustion of pool" the
workers can handle if object caches retain packets, but with enough
threads it can happen that a late starting thread won't be able to
allocate any. This for loop should take that into account and not
trying to access tt[0].ev.

Change-Id: I3648cb7c2b7af91276f8aa4d06ee0f26e3236e7d
Signed-off-by: Zoltan Kiss 
Signed-off-by: Maxim Uvarov 
---
M test/validation/timer/timer.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://review.linaro.org:29418/lng/odp refs/changes/69/10969/1

diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c
index 5854b32..7b76dbf 100644
--- a/test/validation/timer/timer.c
+++ b/test/validation/timer/timer.c
@@ -338,7 +338,7 @@
uint32_t ms;
uint64_t prev_tick = odp_timer_current_tick(tp);
 
-   for (ms = 0; ms < 7 * RANGE_MS / 10; ms++) {
+   for (ms = 0; ms < 7 * RANGE_MS / 10 && allocated > 0; ms++) {
odp_event_t ev;
while ((ev = odp_queue_deq(queue)) != ODP_EVENT_INVALID) {
/* Subtract one from prev_tick to allow for timeouts

-- 
To view, visit https://review.linaro.org/10969
To unsubscribe, visit https://review.linaro.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3648cb7c2b7af91276f8aa4d06ee0f26e3236e7d
Gerrit-PatchSet: 1
Gerrit-Project: lng/odp
Gerrit-Branch: master
Gerrit-Owner: Maxim Uvarov 
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] Change in lng/odp[api-next]: linux-generic: tm: remove not used includes of odp_api.h

2016-03-04 Thread Maxim Uvarov (Code Review)
Maxim Uvarov has uploaded a new change for review.

  https://review.linaro.org/10833

Change subject: linux-generic: tm: remove not used includes of odp_api.h
..

linux-generic: tm: remove not used includes of odp_api.h

Change-Id: I83877ad51f354fe8357ddfff5045c504c016d6b2
Signed-off-by: Maxim Uvarov 
---
M platform/linux-generic/include/odp_timer_wheel_internal.h
M platform/linux-generic/odp_sorted_list.c
M platform/linux-generic/odp_timer_wheel.c
3 files changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://review.linaro.org:29418/lng/odp refs/changes/33/10833/1

diff --git a/platform/linux-generic/include/odp_timer_wheel_internal.h 
b/platform/linux-generic/include/odp_timer_wheel_internal.h
index 54abb77..e17e263 100644
--- a/platform/linux-generic/include/odp_timer_wheel_internal.h
+++ b/platform/linux-generic/include/odp_timer_wheel_internal.h
@@ -14,7 +14,6 @@
 #endif
 
 #include 
-#include 
 
 typedef uint64_t _odp_timer_wheel_t;
 
diff --git a/platform/linux-generic/odp_sorted_list.c 
b/platform/linux-generic/odp_sorted_list.c
index 9c8d3e1..dfa2667 100644
--- a/platform/linux-generic/odp_sorted_list.c
+++ b/platform/linux-generic/odp_sorted_list.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/platform/linux-generic/odp_timer_wheel.c 
b/platform/linux-generic/odp_timer_wheel.c
index 6d98a32..638edf4 100644
--- a/platform/linux-generic/odp_timer_wheel.c
+++ b/platform/linux-generic/odp_timer_wheel.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

-- 
To view, visit https://review.linaro.org/10833
To unsubscribe, visit https://review.linaro.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83877ad51f354fe8357ddfff5045c504c016d6b2
Gerrit-PatchSet: 1
Gerrit-Project: lng/odp
Gerrit-Branch: api-next
Gerrit-Owner: Maxim Uvarov 
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] Change in lng/odp[master]: debian/control: fix build-depends

2015-09-18 Thread Maxim Uvarov (Code Review)
Maxim Uvarov has posted comments on this change.

Change subject: debian/control: fix build-depends
..


Patch Set 2:

Merged, thanks!

Maxim.

-- 
To view, visit https://review.linaro.org/7928
To unsubscribe, visit https://review.linaro.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2deec68f7d19c9b25e39d836ba9b845e067535ed
Gerrit-PatchSet: 2
Gerrit-Project: lng/odp
Gerrit-Branch: master
Gerrit-Owner: Riku Voipio 
Gerrit-Reviewer: Anders Roxell 
Gerrit-Reviewer: Maxim Uvarov 
Gerrit-HasComments: No
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] Change in lng/odp[master]: debian/control: fix build-depends

2015-09-17 Thread Maxim Uvarov (Code Review)
Maxim Uvarov has posted comments on this change.

Change subject: debian/control: fix build-depends
..


Patch Set 1: Code-Review+2

-- 
To view, visit https://review.linaro.org/7928
To unsubscribe, visit https://review.linaro.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2deec68f7d19c9b25e39d836ba9b845e067535ed
Gerrit-PatchSet: 1
Gerrit-Project: lng/odp
Gerrit-Branch: master
Gerrit-Owner: Riku Voipio 
Gerrit-Reviewer: Anders Roxell 
Gerrit-Reviewer: Maxim Uvarov 
Gerrit-HasComments: No
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] Change in lng/odp[master]: debian/control: fix build-depends

2015-09-17 Thread Maxim Uvarov (Code Review)
Hello Anders Roxell,

I'd like you to reexamine a change.  Please visit

https://review.linaro.org/7928

to look at the new patch set (#2).

Change subject: debian/control: fix build-depends
..

debian/control: fix build-depends

Build-Depends: was missing openssl, which is mandatory for
builds.

Change-Id: I2deec68f7d19c9b25e39d836ba9b845e067535ed
Signed-off-by: Riku Voipio 
---
M debian/control
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://review.linaro.org:29418/lng/odp refs/changes/28/7928/2
-- 
To view, visit https://review.linaro.org/7928
To unsubscribe, visit https://review.linaro.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2deec68f7d19c9b25e39d836ba9b845e067535ed
Gerrit-PatchSet: 2
Gerrit-Project: lng/odp
Gerrit-Branch: master
Gerrit-Owner: Riku Voipio 
Gerrit-Reviewer: Anders Roxell 
Gerrit-Reviewer: Maxim Uvarov 
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp