diff --git a/libdm/.exported_symbols.DM_1_02_104 b/libdm/.exported_symbols.DM_1_02_104 index ec5c50b5d..2ec568978 100644 --- a/libdm/.exported_symbols.DM_1_02_104 +++ b/libdm/.exported_symbols.DM_1_02_104 @@ -1,3 +1,4 @@ +dm_report_column_headings dm_report_get_interval_ms dm_report_get_interval_ns dm_report_set_interval_ms diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h index ed9a79e6c..2289d12d0 100644 --- a/libdm/libdevmapper.h +++ b/libdm/libdevmapper.h @@ -1896,6 +1896,14 @@ int dm_report_object_is_selected(struct dm_report *rh, void *object, int do_outp int dm_report_compact_fields(struct dm_report *rh); int dm_report_output(struct dm_report *rh); + +/* + * Output the report headings for a columns-based report, even if they + * have already been shown. Useful for repeating reports that wish to + * issue a periodic reminder of the column headings. + */ +int dm_report_column_headings(struct dm_report *rh); + void dm_report_free(struct dm_report *rh); /* diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c index edb3fe2e3..4b09854fc 100644 --- a/libdm/libdm-report.c +++ b/libdm/libdm-report.c @@ -3922,9 +3922,6 @@ static int _report_headings(struct dm_report *rh) char *buf = NULL; size_t buf_size = 0; - if (rh->flags & RH_HEADINGS_PRINTED) - return 1; - rh->flags |= RH_HEADINGS_PRINTED; if (!(rh->flags & DM_REPORT_OUTPUT_HEADINGS)) @@ -3997,6 +3994,11 @@ static int _report_headings(struct dm_report *rh) return 0; } +int dm_report_column_headings(struct dm_report *rh) +{ + return _report_headings(rh); +} + /* * Sort rows of data */ diff --git a/tools/dmsetup.c b/tools/dmsetup.c index 485301a2a..3d675fd51 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -3970,6 +3970,8 @@ doit: r = _perform_command_for_all_repeatable_args(cmd, subcommand, argc, argv, NULL, multiple_devices); if (_report) { + if (_count > 1) + dm_report_column_headings(_report); dm_report_output(_report); if (_count > 1) {