From: mvs Date: Fri, 28 Apr 2023 20:03:13 +0000 (+0000) Subject: Add rtentry refcnt type to dt(4). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2bb3455c77407e12af41797a30428c212ed015ce;p=openbsd Add rtentry refcnt type to dt(4). ok bluhm@ --- diff --git a/sys/dev/dt/dt_prov_static.c b/sys/dev/dt/dt_prov_static.c index 8f3c41febeb..5bd926dfbcf 100644 --- a/sys/dev/dt/dt_prov_static.c +++ b/sys/dev/dt/dt_prov_static.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dt_prov_static.c,v 1.17 2022/09/11 19:05:44 dv Exp $ */ +/* $OpenBSD: dt_prov_static.c,v 1.18 2023/04/28 20:03:13 mvs Exp $ */ /* * Copyright (c) 2019 Martin Pieuchot @@ -94,6 +94,7 @@ DT_STATIC_PROBE2(smr, thread, "uint64_t", "uint64_t"); DT_STATIC_PROBE0(refcnt, none); DT_STATIC_PROBE3(refcnt, ifaddr, "void *", "int", "int"); DT_STATIC_PROBE3(refcnt, inpcb, "void *", "int", "int"); +DT_STATIC_PROBE3(refcnt, rtentry, "void *", "int", "int"); DT_STATIC_PROBE3(refcnt, tdb, "void *", "int", "int"); /* @@ -140,6 +141,7 @@ struct dt_probe *const dtps_static[] = { &_DT_STATIC_P(refcnt, none), &_DT_STATIC_P(refcnt, ifaddr), &_DT_STATIC_P(refcnt, inpcb), + &_DT_STATIC_P(refcnt, rtentry), &_DT_STATIC_P(refcnt, tdb), }; diff --git a/sys/net/route.c b/sys/net/route.c index d9f59e9a4a1..e7c5442c3bd 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.421 2023/04/27 14:41:09 mvs Exp $ */ +/* $OpenBSD: route.c,v 1.422 2023/04/28 20:03:14 mvs Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -875,7 +875,7 @@ rtrequest(int req, struct rt_addrinfo *info, u_int8_t prio, return (ENOBUFS); } - refcnt_init(&rt->rt_refcnt); + refcnt_init_trace(&rt->rt_refcnt, DT_REFCNT_IDX_RTENTRY); rt->rt_flags = info->rti_flags | RTF_UP; rt->rt_priority = prio; /* init routing priority */ LIST_INIT(&rt->rt_timer); diff --git a/sys/sys/refcnt.h b/sys/sys/refcnt.h index c6a44d6f85f..447973817f4 100644 --- a/sys/sys/refcnt.h +++ b/sys/sys/refcnt.h @@ -1,4 +1,4 @@ -/* $OpenBSD: refcnt.h,v 1.8 2022/08/29 07:51:45 bluhm Exp $ */ +/* $OpenBSD: refcnt.h,v 1.9 2023/04/28 20:03:14 mvs Exp $ */ /* * Copyright (c) 2015 David Gwynne @@ -46,7 +46,8 @@ unsigned int refcnt_read(struct refcnt *); /* sorted alphabetically, keep in sync with dev/dt/dt_prov_static.c */ #define DT_REFCNT_IDX_IFADDR 1 #define DT_REFCNT_IDX_INPCB 2 -#define DT_REFCNT_IDX_TDB 3 +#define DT_REFCNT_IDX_RTENTRY 3 +#define DT_REFCNT_IDX_TDB 4 #endif /* _KERNEL */