Skip to content

Commit

Permalink
Update tracepoints
Browse files Browse the repository at this point in the history
  • Loading branch information
dweeezil committed Apr 8, 2017
1 parent 1e385a8 commit ca90ef0
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 18 deletions.
76 changes: 58 additions & 18 deletions include/sys/trace_vdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,41 +34,81 @@
#include <sys/types.h>

/*
* Generic support for tracepoints of the form:
* Support for tracepoints of the form:
*
* DTRACE_PROBE2(...,
* vdev_t *, ...,
* metaslab_group_t *, ...);
* DTRACE_PROBE3(...,
* vdev_t *vd, ...,
* uint64_t mused, ...,
* uint64_t mlim, ...,
*/
/* BEGIN CSTYLED */
DECLARE_EVENT_CLASS(zfs_vdev_mg_class,
TP_PROTO(vdev_t *vd, metaslab_group_t *mg),
TP_ARGS(vd, mg),
DECLARE_EVENT_CLASS(zfs_vdev_mused_mlim_class,
TP_PROTO(vdev_t *vd, uint64_t mused, uint64_t mlim),
TP_ARGS(vd, mused, mlim),
TP_STRUCT__entry(
__field(uint64_t, vdev_id)
__field(uint64_t, vdev_guid)
__field(boolean_t, mg_allocatable)
__field(uint64_t, mg_free_capacity)
__field(uint64_t, mused)
__field(uint64_t, mlim)
),
TP_fast_assign(
__entry->vdev_id = vd->vdev_id;
__entry->vdev_guid = vd->vdev_guid;
__entry->mg_allocatable = mg->mg_allocatable;
__entry->mg_free_capacity = mg->mg_free_capacity;
__entry->mused = mused;
__entry->mlim = mlim;
),
TP_printk("vd { vdev_id %llu vdev_guid %llu }"
"mg { mg_allocatable %d mg_free_capacity %llu }",
" mused = %llu mlim = %llu",
__entry->vdev_id, __entry->vdev_guid,
__entry->mg_allocatable, __entry->mg_free_capacity)
__entry->mused, __entry->mlim)
);
/* END CSTYLED */

/* BEGIN CSTYLED */
#define DEFINE_VDEV_MUSED_MLIM_EVENT(name) \
DEFINE_EVENT(zfs_vdev_mused_mlim_class, name, \
TP_PROTO(vdev_t *vd, uint64_t mused, uint64_t mlim), \
TP_ARGS(vd, mused, mlim))
/* END CSTYLED */
DEFINE_VDEV_MUSED_MLIM_EVENT(zfs_autotrim__mem__lim);

/*
* Generic support for tracepoints of the form:
*
* DTRACE_PROBE1(...,
* metaslab_t *, ...,
*/
/* BEGIN CSTYLED */
DECLARE_EVENT_CLASS(zfs_msp_class,
TP_PROTO(metaslab_t *msp),
TP_ARGS(msp),
TP_STRUCT__entry(
__field(uint64_t, ms_id)
__field(uint64_t, ms_start)
__field(uint64_t, ms_size)
__field(uint64_t, ms_fragmentation)
),
TP_fast_assign(
__entry->ms_id = msp->ms_id;
__entry->ms_start = msp->ms_start;
__entry->ms_size = msp->ms_size;
__entry->ms_fragmentation = msp->ms_fragmentation;
),
TP_printk("msp { ms_id %llu ms_start %llu ms_size %llu "
"ms_fragmentation %llu }",
__entry->ms_id, __entry->ms_start,
__entry->ms_size, __entry->ms_fragmentation)
);
/* END CSTYLED */

/* BEGIN CSTYLED */
#define DEFINE_VDEV_MG_EVENT(name) \
DEFINE_EVENT(zfs_vdev_mg_class, name, \
TP_PROTO(vdev_t *vd, metaslab_group_t *mg), \
TP_ARGS(vd, mg))
#define DEFINE_MSP_EVENT(name) \
DEFINE_EVENT(zfs_msp_class, name, \
TP_PROTO(metaslab_t *msp), \
TP_ARGS(msp))
/* END CSTYLED */
DEFINE_VDEV_MG_EVENT(zfs_vdev_trim_all_restart);
DEFINE_MSP_EVENT(zfs_preserve__spilled);
DEFINE_MSP_EVENT(zfs_drop__spilled);

#endif /* _TRACE_VDEV_H */

Expand Down
1 change: 1 addition & 0 deletions module/zfs/metaslab.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <sys/zio.h>
#include <sys/spa_impl.h>
#include <sys/zfeature.h>
#include <sys/trace_vdev.h>

#define WITH_DF_BLOCK_ALLOCATOR

Expand Down

0 comments on commit ca90ef0

Please sign in to comment.