diff mbox series

[ovs-dev,v2] ovs-ctl: Allow inclusion of hugepages in coredumps

Message ID 20221219133838.126286-1-mkp@redhat.com
State Accepted
Commit d34245ea150a7ae4dbae9e7fc37e3adfcbbf0bc6
Headers show
Series [ovs-dev,v2] ovs-ctl: Allow inclusion of hugepages in coredumps | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Mike Pattrick Dec. 19, 2022, 1:38 p.m. UTC
Add new option --dump-hugepages option in ovs-ctl to enable the addition
of hugepages in the core dump filter.

Signed-off-by: Mike Pattrick <mkp@redhat.com>

---

V2:
 - Rebased NEWS
 - Included shared huge pages in dump
Signed-off-by: Mike Pattrick <mkp@redhat.com>
---
 NEWS                 |  4 ++++
 utilities/ovs-ctl.in | 15 +++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

Comments

David Marchand Dec. 19, 2022, 2:28 p.m. UTC | #1
On Mon, Dec 19, 2022 at 2:39 PM Mike Pattrick <mkp@redhat.com> wrote:
>
> Add new option --dump-hugepages option in ovs-ctl to enable the addition
> of hugepages in the core dump filter.
>
> Signed-off-by: Mike Pattrick <mkp@redhat.com>

LGTM.
Reviewed-by: David Marchand <david.marchand@redhat.com>
Ilya Maximets Dec. 20, 2022, 3:27 p.m. UTC | #2
On 12/19/22 15:28, David Marchand wrote:
> On Mon, Dec 19, 2022 at 2:39 PM Mike Pattrick <mkp@redhat.com> wrote:
>>
>> Add new option --dump-hugepages option in ovs-ctl to enable the addition
>> of hugepages in the core dump filter.
>>
>> Signed-off-by: Mike Pattrick <mkp@redhat.com>
> 
> LGTM.
> Reviewed-by: David Marchand <david.marchand@redhat.com>


Applied.  Thanks!

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/NEWS b/NEWS
index 265375e1c..95d82632f 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,10 @@  Post-v3.0.0
      10 Gbps link speed by default in case the actual link speed cannot be
      determined.  Previously it was 10 Mbps.  Values can still be overridden
      by specifying 'max-rate' or '[r]stp-path-cost' accordingly.
+   - ovs-ctl:
+     * New option '--dump-hugepages' to include hugepages in core dumps. This
+       can assist with postmortem analysis involving DPDK, but may also produce
+       significantly larger core dump files.
 
 
 v3.0.0 - 15 Aug 2022
diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index eba9512fe..0cc9c9f45 100644
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -103,8 +103,13 @@  set_system_ids () {
     action "Configuring Open vSwitch system IDs" "$@" $extra_ids
 }
 
-check_force_cores () {
-    if test X"$FORCE_COREFILES" = Xyes; then
+check_core_config () {
+    if test X"$DUMP_HUGEPAGES" = Xyes; then
+        echo 0x7f > /proc/self/coredump_filter
+        if test X"$FORCE_COREFILES" = Xyes; then
+            ulimit -c unlimited
+        fi
+    elif test X"$FORCE_COREFILES" = Xyes; then
         ulimit -c 67108864
     fi
 }
@@ -116,7 +121,7 @@  del_transient_ports () {
 }
 
 do_start_ovsdb () {
-    check_force_cores
+    check_core_config
 
     if daemon_is_running ovsdb-server; then
         log_success_msg "ovsdb-server is already running"
@@ -193,7 +198,7 @@  add_managers () {
 }
 
 do_start_forwarding () {
-    check_force_cores
+    check_core_config
 
     insert_mod_if_required || return 1
 
@@ -330,6 +335,7 @@  set_defaults () {
 
     DAEMON_CWD=/
     FORCE_COREFILES=yes
+    DUMP_HUGEPAGES=no
     MLOCKALL=yes
     SELF_CONFINEMENT=yes
     MONITOR=yes
@@ -419,6 +425,7 @@  Other important options for "start", "restart" and "force-reload-kmod":
 Less important options for "start", "restart" and "force-reload-kmod":
   --daemon-cwd=DIR               set working dir for OVS daemons (default: $DAEMON_CWD)
   --no-force-corefiles           do not force on core dumps for OVS daemons
+  --dump-hugepages               include hugepages in coredumps
   --no-mlockall                  do not lock all of ovs-vswitchd into memory
   --ovsdb-server-priority=NICE   set ovsdb-server's niceness (default: $OVSDB_SERVER_PRIORITY)
   --ovsdb-server-options=OPTIONS additional options for ovsdb-server (example: '-vconsole:dbg -vfile:dbg')