Print this page
4823 don't open-code NSEC2MSEC and MSEC2NSEC


1028 simple_report_collection_cb(lcollection_t *lcol, void *arg)
1029 {
1030 #define DELTA(field) \
1031         (unsigned long long)( \
1032             (lcol->lcol_stat.field - lcol->lcol_stat_old.field))
1033 
1034         debug("%s %s status: succeeded/attempted (k): %llu/%llu, "
1035             "ineffective/scans/unenforced/samplings:  %llu/%llu/%llu/%llu, RSS "
1036             "min/max (k): %llu/%llu, cap %llu kB, processes/thpt: %llu/%llu, "
1037             "%llu scans over %llu ms\n",
1038             (lcol->lcol_id.rcid_type == RCIDT_PROJECT ? "project" : "zone"),
1039             lcol->lcol_name,
1040             DELTA(lcols_pg_eff), DELTA(lcols_pg_att),
1041             DELTA(lcols_scan_ineffective), DELTA(lcols_scan),
1042             DELTA(lcols_unenforced_cap), DELTA(lcols_rss_sample),
1043             (unsigned long long)lcol->lcol_stat.lcols_min_rss,
1044             (unsigned long long)lcol->lcol_stat.lcols_max_rss,
1045             (unsigned long long)lcol->lcol_rss_cap,
1046             (unsigned long long)(lcol->lcol_stat.lcols_proc_in -
1047             lcol->lcol_stat.lcols_proc_out), DELTA(lcols_proc_out),
1048             DELTA(lcols_scan_count), DELTA(lcols_scan_time_complete) / (NANOSEC
1049             / MILLISEC));
1050 
1051 #undef DELTA
1052 
1053         return (0);
1054 }
1055 
1056 /*
1057  * Record each collection's interval statistics in the statistics file.
1058  */
1059 static int
1060 report_collection_cb(lcollection_t *lcol, void *arg)
1061 {
1062         lcollection_report_t dc;
1063         int fd = (intptr_t)arg;
1064 
1065         /*
1066          * Copy the relevant fields to the collection's record.
1067          */
1068         bzero(&dc, sizeof (dc));
1069         dc.lcol_id = lcol->lcol_id;




1028 simple_report_collection_cb(lcollection_t *lcol, void *arg)
1029 {
1030 #define DELTA(field) \
1031         (unsigned long long)( \
1032             (lcol->lcol_stat.field - lcol->lcol_stat_old.field))
1033 
1034         debug("%s %s status: succeeded/attempted (k): %llu/%llu, "
1035             "ineffective/scans/unenforced/samplings:  %llu/%llu/%llu/%llu, RSS "
1036             "min/max (k): %llu/%llu, cap %llu kB, processes/thpt: %llu/%llu, "
1037             "%llu scans over %llu ms\n",
1038             (lcol->lcol_id.rcid_type == RCIDT_PROJECT ? "project" : "zone"),
1039             lcol->lcol_name,
1040             DELTA(lcols_pg_eff), DELTA(lcols_pg_att),
1041             DELTA(lcols_scan_ineffective), DELTA(lcols_scan),
1042             DELTA(lcols_unenforced_cap), DELTA(lcols_rss_sample),
1043             (unsigned long long)lcol->lcol_stat.lcols_min_rss,
1044             (unsigned long long)lcol->lcol_stat.lcols_max_rss,
1045             (unsigned long long)lcol->lcol_rss_cap,
1046             (unsigned long long)(lcol->lcol_stat.lcols_proc_in -
1047             lcol->lcol_stat.lcols_proc_out), DELTA(lcols_proc_out),
1048             DELTA(lcols_scan_count),
1049             NSEC2MSEC(DELTA(lcols_scan_time_complete)));
1050 
1051 #undef DELTA
1052 
1053         return (0);
1054 }
1055 
1056 /*
1057  * Record each collection's interval statistics in the statistics file.
1058  */
1059 static int
1060 report_collection_cb(lcollection_t *lcol, void *arg)
1061 {
1062         lcollection_report_t dc;
1063         int fd = (intptr_t)arg;
1064 
1065         /*
1066          * Copy the relevant fields to the collection's record.
1067          */
1068         bzero(&dc, sizeof (dc));
1069         dc.lcol_id = lcol->lcol_id;