Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: Add ability to track time in individual routemaps #12109

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

donaldsharp
Copy link
Member

Add some ability to the show route-map command to track how much time was spent in each section and total time for the route-map

@frrbot frrbot bot added the libfrr label Oct 12, 2022
doc/user/routemap.rst Outdated Show resolved Hide resolved
tests/topotests/zebra_rib/r1/static_rmap.ref Outdated Show resolved Hide resolved
@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Oct 12, 2022

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-7857/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Failed

Ubuntu 18.04 i386 build: Failed (click for details)

Make failed for Ubuntu 18.04 i386 build:
(see full Make log at https://ci1.netdef.org/browse/FRR-PULLREQ2-7857/artifact/U18I386BUILD/ErrorLog/log_make.txt)

make[1]: Entering directory '/home/ci/cibuild.7857/frr-source'
lib/routemap.c: In function route_map_apply_ext:
lib/routemap.c:2584:44: error: passing argument 3 of thread_consumed_time from incompatible pointer type [-Werror=incompatible-pointer-types]
In file included from lib/vty.h:31:0,
lib/thread.h:278:22: note: expected long unsigned int * but argument is of type size_t * {aka unsigned int *}
 extern unsigned long thread_consumed_time(RUSAGE_T *after, RUSAGE_T *before,
lib/routemap.c:2731:43: error: passing argument 3 of thread_consumed_time from incompatible pointer type [-Werror=incompatible-pointer-types]
In file included from lib/vty.h:31:0,
lib/thread.h:278:22: note: expected long unsigned int * but argument is of type size_t * {aka unsigned int *}

Ubuntu 18.04 i386 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-PULLREQ2-7857/artifact/U18I386BUILD/config.status/config.status
Ubuntu 18.04 i386 build: Unknown Log <config.log.gz>
URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-7857/artifact/U18I386BUILD/config.log/config.log.gz

Ubuntu 16.04 i386 build: Failed (click for details) Ubuntu 16.04 i386 build: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-7857/artifact/U1604I386/config.log/config.log.gz Ubuntu 16.04 i386 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-PULLREQ2-7857/artifact/U1604I386/config.status/config.status

Make failed for Ubuntu 16.04 i386 build:
(see full Make log at https://ci1.netdef.org/browse/FRR-PULLREQ2-7857/artifact/U1604I386/ErrorLog/log_make.txt)

make[1]: Entering directory '/home/ci/cibuild.7857/frr-source'
lib/routemap.c: In function route_map_apply_ext:
lib/routemap.c:2584:44: error: passing argument 3 of thread_consumed_time from incompatible pointer type [-Werror=incompatible-pointer-types]
In file included from lib/vty.h:31:0,
lib/thread.h:278:22: note: expected long unsigned int * but argument is of type size_t * {aka unsigned int *}
 extern unsigned long thread_consumed_time(RUSAGE_T *after, RUSAGE_T *before,
lib/routemap.c:2731:43: error: passing argument 3 of thread_consumed_time from incompatible pointer type [-Werror=incompatible-pointer-types]
In file included from lib/vty.h:31:0,
lib/thread.h:278:22: note: expected long unsigned int * but argument is of type size_t * {aka unsigned int *}
Ubuntu 18.04 arm7 build: Failed (click for details) Ubuntu 18.04 arm7 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-PULLREQ2-7857/artifact/U18ARM7BUILD/config.status/config.status Ubuntu 18.04 arm7 build: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-7857/artifact/U18ARM7BUILD/config.log/config.log.gz

Make failed for Ubuntu 18.04 arm7 build:
(see full Make log at https://ci1.netdef.org/browse/FRR-PULLREQ2-7857/artifact/U18ARM7BUILD/ErrorLog/log_make.txt)

make[1]: Entering directory '/home/ci/cibuild.7857/frr-source'
lib/routemap.c: In function route_map_apply_ext:
lib/routemap.c:2584:44: error: passing argument 3 of thread_consumed_time from incompatible pointer type [-Werror=incompatible-pointer-types]
In file included from lib/vty.h:31:0,
lib/thread.h:278:22: note: expected long unsigned int * but argument is of type size_t * {aka unsigned int *}
 extern unsigned long thread_consumed_time(RUSAGE_T *after, RUSAGE_T *before,
lib/routemap.c:2731:43: error: passing argument 3 of thread_consumed_time from incompatible pointer type [-Werror=incompatible-pointer-types]
In file included from lib/vty.h:31:0,
lib/thread.h:278:22: note: expected long unsigned int * but argument is of type size_t * {aka unsigned int *}
Ubuntu 16.04 arm7 build: Failed (click for details)

Make failed for Ubuntu 16.04 arm7 build:
(see full Make log at https://ci1.netdef.org/browse/FRR-PULLREQ2-7857/artifact/CI101BUILD/ErrorLog/log_make.txt)

make[1]: Entering directory '/home/ci/cibuild.7857/frr-source'
lib/routemap.c: In function route_map_apply_ext:
lib/routemap.c:2584:44: error: passing argument 3 of thread_consumed_time from incompatible pointer type [-Werror=incompatible-pointer-types]
In file included from lib/vty.h:31:0,
lib/thread.h:278:22: note: expected long unsigned int * but argument is of type size_t * {aka unsigned int *}
 extern unsigned long thread_consumed_time(RUSAGE_T *after, RUSAGE_T *before,
lib/routemap.c:2731:43: error: passing argument 3 of thread_consumed_time from incompatible pointer type [-Werror=incompatible-pointer-types]
In file included from lib/vty.h:31:0,
lib/thread.h:278:22: note: expected long unsigned int * but argument is of type size_t * {aka unsigned int *}

Ubuntu 16.04 arm7 build: Unknown Log <config.log.gz>
URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-7857/artifact/CI101BUILD/config.log/config.log.gz
Ubuntu 16.04 arm7 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-PULLREQ2-7857/artifact/CI101BUILD/config.status/config.status

Successful on other platforms/tests
  • Debian 11 amd64 build
  • Ubuntu 18.04 amd64 build
  • Ubuntu 16.04 amd64 build
  • NetBSD 9 amd64 build
  • CentOS 7 amd64 build
  • Ubuntu 16.04 arm8 build
  • Redhat 8 amd64 build
  • OpenBSD 7 amd64 build
  • FreeBSD 12 amd64 build
  • Fedora 29 amd64 build
  • Ubuntu 20.04 amd64 build
  • Ubuntu 18.04 arm8 build
  • Debian 9 amd64 build
  • Ubuntu 18.04 ppc64le build
  • Redhat 9 amd64 build
  • Debian 10 amd64 build
  • Ubuntu 22.04 amd64 build
  • FreeBSD 11 amd64 build

Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Oct 12, 2022

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-7859/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Failed

Topotests Ubuntu 18.04 amd64 part 7: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO7U18AMD64-7859/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 7
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-7859/artifact/TOPO7U18AMD64/ErrorLog/log_topotests.txt

Topotests debian 10 amd64 part 7: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO7DEB10AMD64-7859/test

Topology Tests failed for Topotests debian 10 amd64 part 7
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-7859/artifact/TOPO7DEB10AMD64/ErrorLog/log_topotests.txt

Topotests Ubuntu 18.04 i386 part 7: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO7U18I386-7859/test

Topology Tests failed for Topotests Ubuntu 18.04 i386 part 7
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-7859/artifact/TOPO7U18I386/ErrorLog/log_topotests.txt

Topotests Ubuntu 18.04 arm8 part 7: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 7: No useful log found
Successful on other platforms/tests
  • Fedora 29 rpm pkg check
  • Topotests debian 10 amd64 part 1
  • Topotests Ubuntu 18.04 i386 part 5
  • Topotests Ubuntu 18.04 i386 part 0
  • Addresssanitizer topotests part 3
  • Topotests Ubuntu 18.04 amd64 part 4
  • CentOS 7 rpm pkg check
  • Topotests Ubuntu 18.04 i386 part 9
  • Addresssanitizer topotests part 2
  • Topotests Ubuntu 18.04 amd64 part 0
  • Topotests debian 10 amd64 part 5
  • Addresssanitizer topotests part 1
  • Topotests Ubuntu 18.04 i386 part 4
  • Topotests Ubuntu 18.04 amd64 part 1
  • Debian 9 deb pkg check
  • Addresssanitizer topotests part 8
  • Topotests Ubuntu 18.04 amd64 part 6
  • Topotests Ubuntu 18.04 arm8 part 8
  • Ubuntu 18.04 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 6
  • Topotests Ubuntu 18.04 i386 part 2
  • Addresssanitizer topotests part 6
  • Topotests Ubuntu 18.04 arm8 part 1
  • Topotests debian 10 amd64 part 6
  • Topotests Ubuntu 18.04 arm8 part 3
  • Addresssanitizer topotests part 5
  • Topotests debian 10 amd64 part 4
  • Topotests Ubuntu 18.04 i386 part 3
  • Topotests Ubuntu 18.04 amd64 part 2
  • Addresssanitizer topotests part 4
  • Topotests debian 10 amd64 part 3
  • Addresssanitizer topotests part 0
  • Topotests debian 10 amd64 part 8
  • Topotests debian 10 amd64 part 9
  • Topotests Ubuntu 18.04 arm8 part 4
  • Topotests Ubuntu 18.04 arm8 part 9
  • Topotests Ubuntu 18.04 amd64 part 3
  • Static analyzer (clang)
  • Topotests Ubuntu 18.04 arm8 part 2
  • Topotests debian 10 amd64 part 0
  • Topotests Ubuntu 18.04 i386 part 6
  • Topotests Ubuntu 18.04 amd64 part 8
  • Topotests debian 10 amd64 part 2
  • Addresssanitizer topotests part 9
  • Ubuntu 16.04 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 0
  • Topotests Ubuntu 18.04 arm8 part 5
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests Ubuntu 18.04 i386 part 1
  • Topotests Ubuntu 18.04 amd64 part 9
  • Addresssanitizer topotests part 7
  • Ubuntu 20.04 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 5
  • Debian 10 deb pkg check

@riw777 riw777 self-requested a review October 18, 2022 15:41
Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@riw777
Copy link
Member

riw777 commented Dec 13, 2022

ci:rerun -- no report from prior run

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Dec 13, 2022

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

Test incomplete. See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-8834/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Incomplete

Topotests Ubuntu 18.04 amd64 part 7: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO7U18AMD64-8834/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 7
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-8834/artifact/TOPO7U18AMD64/ErrorLog/log_topotests.txt

Topotests Ubuntu 18.04 arm8 part 7: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 7: No useful log found
Addresssanitizer topotests part 9: Incomplete (check logs for details)
Topotests Ubuntu 18.04 i386 part 7: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO7U18I386-8834/test

Topology Tests failed for Topotests Ubuntu 18.04 i386 part 7
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-8834/artifact/TOPO7U18I386/ErrorLog/log_topotests.txt

Topotests debian 10 amd64 part 7: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO7DEB10AMD64-8834/test

Topology Tests failed for Topotests debian 10 amd64 part 7
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-8834/artifact/TOPO7DEB10AMD64/ErrorLog/log_topotests.txt

Successful on other platforms/tests
  • Topotests Ubuntu 18.04 amd64 part 6
  • Topotests Ubuntu 18.04 i386 part 8
  • Addresssanitizer topotests part 0
  • Topotests debian 10 amd64 part 8
  • Ubuntu 20.04 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 4
  • Topotests Ubuntu 18.04 arm8 part 9
  • Debian 10 deb pkg check
  • Topotests debian 10 amd64 part 3
  • Addresssanitizer topotests part 1
  • Topotests Ubuntu 18.04 i386 part 4
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests debian 10 amd64 part 4
  • Topotests Ubuntu 18.04 i386 part 3
  • Addresssanitizer topotests part 4
  • Debian 9 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 9
  • Topotests Ubuntu 18.04 i386 part 9
  • Addresssanitizer topotests part 7
  • Static analyzer (clang)
  • Ubuntu 16.04 deb pkg check
  • Addresssanitizer topotests part 5
  • Topotests debian 10 amd64 part 1
  • Topotests Ubuntu 18.04 i386 part 6
  • Topotests Ubuntu 18.04 i386 part 1
  • Topotests Ubuntu 18.04 amd64 part 8
  • Topotests debian 10 amd64 part 2
  • Topotests Ubuntu 18.04 arm8 part 0
  • Topotests Ubuntu 18.04 arm8 part 5
  • Topotests Ubuntu 18.04 amd64 part 4
  • Topotests Ubuntu 18.04 arm8 part 1
  • Topotests Ubuntu 18.04 amd64 part 0
  • Topotests Ubuntu 18.04 arm8 part 6
  • Addresssanitizer topotests part 2
  • Topotests debian 10 amd64 part 6
  • Topotests Ubuntu 18.04 amd64 part 5
  • Fedora 29 rpm pkg check
  • Topotests debian 10 amd64 part 5
  • Topotests debian 10 amd64 part 0
  • Topotests Ubuntu 18.04 arm8 part 2
  • Addresssanitizer topotests part 3
  • Addresssanitizer topotests part 8
  • CentOS 7 rpm pkg check
  • Topotests Ubuntu 18.04 arm8 part 8
  • Topotests debian 10 amd64 part 9
  • Topotests Ubuntu 18.04 amd64 part 3
  • Topotests Ubuntu 18.04 i386 part 2
  • Addresssanitizer topotests part 6
  • Topotests Ubuntu 18.04 i386 part 5
  • Topotests Ubuntu 18.04 amd64 part 1
  • Ubuntu 18.04 deb pkg check
  • Topotests Ubuntu 18.04 i386 part 0
  • Topotests Ubuntu 18.04 amd64 part 2

Copy link
Contributor

@eqvinox eqvinox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion for improvement: use clock_gettime(CLOCK_THREAD_CPUTIME_ID) instead of getrusage() if available — the former can be optimized away to 0 syscalls on some CPUs and OSes, while the latter always requires a syscall to fill in the other information.

(not a NAK, just a suggestion :D)

@eqvinox
Copy link
Contributor

eqvinox commented Dec 13, 2022

(there's already some code using CLOCK_THREAD_CPUTIME_ID in lib/thread.c with checks for availability, you can copypasta from there)

@riw777
Copy link
Member

riw777 commented Jan 24, 2023

I think the tests are failing because of the changes in output ...

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@riw777
Copy link
Member

riw777 commented Mar 7, 2023

waiting on ci and conflicts ...

@riw777
Copy link
Member

riw777 commented Apr 18, 2023

history expired ... rerunning
ci:rerun

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Apr 18, 2023

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-10948/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Failed

Checkout code: Failed (click for details)

PullReq merge failed. Please rebase your branch:
see merge log in attachment https://ci1.netdef.org/browse/FRR-PULLREQ2-10948/artifact/CHECKOUT/ErrorLog/log_merge.txt

@riw777
Copy link
Member

riw777 commented Aug 8, 2023

history expired ... rerunning ...
ci:rerun

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Aug 8, 2023

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-13368/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Failed

Checkout code: Failed (click for details)

PullReq merge failed. Please rebase your branch:
see merge log in attachment https://ci1.netdef.org/browse/FRR-PULLREQ2-13368/artifact/CHECKOUT/ErrorLog/log_merge.txt

@riw777
Copy link
Member

riw777 commented Aug 15, 2023

looks like this needs to be rebased ...

@riw777
Copy link
Member

riw777 commented Aug 15, 2023

@Mergifyio rebase

@mergify
Copy link

mergify bot commented Aug 15, 2023

rebase

❌ Unable to rebase: user riw777 is unknown.

Please make sure riw777 has logged in Mergify dashboard.

@riw777
Copy link
Member

riw777 commented Aug 29, 2023

@Mergifyio rebase

@mergify
Copy link

mergify bot commented Aug 29, 2023

rebase

❌ Base branch update has failed

Git reported the following error:

Rebasing (1/1)
Auto-merging doc/user/routemap.rst
Auto-merging lib/routemap.c
CONFLICT (content): Merge conflict in lib/routemap.c
Auto-merging lib/routemap.h
error: could not apply 581dac3dd... lib: Add ability to track time in individual routemaps
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 581dac3dd... lib: Add ability to track time in individual routemaps

err-code: AE6CD

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-14021/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Failed

Redhat 8 amd64 build: Failed (click for details) Redhat 8 amd64 build: No useful log found
Ubuntu 18.04 arm8 build: Failed (click for details) Ubuntu 18.04 arm8 build: No useful log found
Successful on other platforms/tests
  • OpenBSD 7 amd64 build
  • Debian 10 amd64 build
  • Ubuntu 22.04 amd64 build
  • FreeBSD 11 amd64 build
  • Ubuntu 20.04 amd64 build
  • Debian 9 amd64 build
  • CentOS 7 amd64 build
  • Redhat 9 amd64 build
  • Ubuntu 18.04 ppc64le build
  • Ubuntu 18.04 amd64 build
  • FreeBSD 12 amd64 build
  • Ubuntu 18.04 i386 build
  • Ubuntu 18.04 arm7 build
  • Debian 11 amd64 build

@riw777
Copy link
Member

riw777 commented Oct 24, 2023

failed to compile on a couple of platforms, let's see if things are better now
ci:rerun

@riw777
Copy link
Member

riw777 commented Jan 2, 2024

zebra_rib.test_zebra_rib test_route_map_usage(16.821 s)

E AssertionError: --- Actual Route-map output
+++ Expected Route-map output
@@ -36,7 +36,7 @@
0

   (
  -3
  +0
    
   m
   i
assert False

This probably needs to be looked at ... :-(

Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Add the abilty to track how much time is spent in routemaps.
Example of the new output:

eva# show route-map
ZEBRA:
route-map: FOO Invoked: 1000000 (323 milliseconds total) Optimization: enabled Processed Change: false
 deny, sequence 10 Invoked 1000000 (320 milliseconds total)
  Match clauses:
  Set clauses:
  Call clause:
  Action:
    Exit routemap

Signed-off-by: Donald Sharp <[email protected]>
@riw777 riw777 merged commit 68ec006 into FRRouting:master Nov 7, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants