You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2019/10/11 00:58:18 UTC

[mynewt-core] branch master updated (f3d0ff2 -> 7b824ca)

This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git.


    from f3d0ff2  Merge pull request #1917 from vrahane/mcumgr
     new fabc0a0  mbuf.gdb: mn_msys1_free_print-->mn_msys1_free_list
     new 4a2987d  mbuf.gdb: mn_mbuf_pool_dump macro
     new 51ca86b  mbuf.gdb: mn_msys1_dump
     new 7b824ca  stat.gdb: gdb scripts for stats debugging

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 compiler/gdbmacros/mbuf.gdb | 39 ++++++++++++++++++++++++-
 compiler/gdbmacros/stat.gdb | 69 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 107 insertions(+), 1 deletion(-)
 create mode 100644 compiler/gdbmacros/stat.gdb


[mynewt-core] 02/04: mbuf.gdb: mn_mbuf_pool_dump macro

Posted by cc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 4a2987d65455c179ff2be5bb6eeef71c66fda804
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Thu Oct 10 12:18:48 2019 -0700

    mbuf.gdb: mn_mbuf_pool_dump macro
    
    usage: mn_mbuf_pool_dump <struct os_mbuf_pool *>
    
    Applies the mn_mbuf_dump function to each element in the specified pool.
    Both allocated and unallocated mbufs are dumped.
---
 compiler/gdbmacros/mbuf.gdb | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/compiler/gdbmacros/mbuf.gdb b/compiler/gdbmacros/mbuf.gdb
index b1713bc..688825e 100644
--- a/compiler/gdbmacros/mbuf.gdb
+++ b/compiler/gdbmacros/mbuf.gdb
@@ -185,6 +185,26 @@ Applies the mn_mbuf_print function to each element in the specified pool.  Both
 allocated and unallocated mbufs are printed.
 end
 
+define mn_mbuf_pool_dump
+    set $pool = ($arg0)
+    set $om = (struct os_mbuf *)$pool->omp_pool.mp_membuf_addr
+    set $elem_size = $pool->omp_databuf_len + sizeof (struct os_mbuf)
+    set $end = (uint8_t *)$om + $pool->omp_pool.mp_num_blocks * $elem_size
+
+    while $om < $end
+        printf "Mbuf addr: %p\n", $om
+        mn_mbuf_dump $om
+        set $om = (struct os_mbuf *)((uint8_t *)$om + $elem_size)
+    end
+end
+
+document mn_mbuf_pool_dump
+usage: mn_mbuf_pool_dump <struct os_mbuf_pool *>
+
+Applies the mn_mbuf_dump function to each element in the specified pool.  Both
+allocated and unallocated mbufs are dumped.
+end
+
 define mn_msys1_print
     mn_mbuf_pool_print &os_msys_1_mbuf_pool
 end


[mynewt-core] 03/04: mbuf.gdb: mn_msys1_dump

Posted by cc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 51ca86bfd1d1a4c2cf25f0ed1cb4494e72a0ae86
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Thu Oct 10 12:19:21 2019 -0700

    mbuf.gdb: mn_msys1_dump
    
    Dumps all mbufs in the first msys pool.  Both allocated and unallocated
    mbufs are dumped.
---
 compiler/gdbmacros/mbuf.gdb | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/compiler/gdbmacros/mbuf.gdb b/compiler/gdbmacros/mbuf.gdb
index 688825e..c8c8e32 100644
--- a/compiler/gdbmacros/mbuf.gdb
+++ b/compiler/gdbmacros/mbuf.gdb
@@ -216,6 +216,17 @@ Prints all mbufs in the first msys pool.  Both allocated and unallocated mbufs
 are printed.
 end
 
+define mn_msys1_dump
+    mn_mbuf_pool_dump &os_msys_1_mbuf_pool
+end
+
+document mn_msys1_dump
+usage: mn_msys1_dump
+
+Dumps all mbufs in the first msys pool.  Both allocated and unallocated mbufs
+are dumped.
+end
+
 define mn_msys1_free_list
     set $om = os_msys_1_mempool.slh_first
 


[mynewt-core] 04/04: stat.gdb: gdb scripts for stats debugging

Posted by cc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 7b824caf6510e465158b91c1c191f295b77c58bf
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Thu Oct 10 15:34:08 2019 -0700

    stat.gdb: gdb scripts for stats debugging
---
 compiler/gdbmacros/stat.gdb | 69 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/compiler/gdbmacros/stat.gdb b/compiler/gdbmacros/stat.gdb
new file mode 100644
index 0000000..047b3b8
--- /dev/null
+++ b/compiler/gdbmacros/stat.gdb
@@ -0,0 +1,69 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#  http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+define mn_stat_print
+    set $shdr = $arg0
+    printf "<%s>\n", $shdr->s_name
+
+    set $idx = 0
+    while $idx < $shdr->s_cnt
+        set $name_entry = &$shdr->s_map[$idx]
+        set $val_addr = (uint8_t *)$shdr + $name_entry->snm_off
+
+        # No "else if" chains in gdb; simplify to avoid nesting.
+        if $shdr->s_size == 1
+            set $val = *(uint8_t *)$val_addr
+        end
+        if $shdr->s_size == 2
+            set $val = *(uint16_t *)$val_addr
+        end
+        if $shdr->s_size == 4
+            set $val = *(uint32_t *)$val_addr
+        end
+
+        printf "%s: %llu\n", $name_entry->snm_name, (unsigned long long)$val
+
+        set $idx++
+    end
+end
+
+document mn_stat_print
+usage: mn_stat_print <struct stats_hdr *>
+
+Prints the stats group with the specified header.
+
+Note: Requires MYNEWT_VAL(STATS_NAMES) to be enabled.
+end
+
+define mn_stat_print_all
+    set $cur = g_stats_registry.stqh_first
+    while $cur != 0
+        mn_stat_print $cur
+        set $cur = $cur->s_next.stqe_next
+
+        if $cur != 0
+            printf "\n"
+        end
+    end
+end
+
+
+document mn_stat_print_all
+usage: mn_stat_print_all
+
+Prints all registered stats groups.
+end


[mynewt-core] 01/04: mbuf.gdb: mn_msys1_free_print-->mn_msys1_free_list

Posted by cc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit fabc0a00aa103b60f7edcc312e652da82fdc9566
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Thu Oct 10 12:14:59 2019 -0700

    mbuf.gdb: mn_msys1_free_print-->mn_msys1_free_list
    
    This macro just lists mbuf addresses, whereas the "print" macros
    actually print the mbuf headers.  To maintain consistency, rename this
    macro with "list" rather than "print".
---
 compiler/gdbmacros/mbuf.gdb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/compiler/gdbmacros/mbuf.gdb b/compiler/gdbmacros/mbuf.gdb
index 9ece3b8..b1713bc 100644
--- a/compiler/gdbmacros/mbuf.gdb
+++ b/compiler/gdbmacros/mbuf.gdb
@@ -196,7 +196,7 @@ Prints all mbufs in the first msys pool.  Both allocated and unallocated mbufs
 are printed.
 end
 
-define mn_msys1_free_print
+define mn_msys1_free_list
     set $om = os_msys_1_mempool.slh_first
 
     while $om != 0
@@ -204,3 +204,9 @@ define mn_msys1_free_print
         set $om = $om->mb_next.sle_next
     end
 end
+
+document mn_msys1_free_list
+usage: mn_msys1_free_list
+
+Prints the addresses of all free mbufs in the first msys pool.
+end