4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2000-2002 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include "statistics.h"
31 static sort_statistics_t
*run_stats
;
34 stats_init(sort_statistics_t
*s
)
37 memset(s
, 0, sizeof (sort_statistics_t
));
43 (void) fprintf(stderr
,
44 "Lines fetched: %20llu\n"
45 "Lines shelved: %20llu\n"
47 "Lines put uniquely: %20llu\n"
48 "Lines not unique: %20llu\n"
54 "Available memory: %20llu\n"
55 "Insert filled input:%20llu\n"
56 "Insert filled up: %20llu\n"
57 "Insert filled down: %20llu\n"
59 "Convert reallocs: %20llu\n"
60 "Line conversions: %20llu\n",
61 run_stats
->st_fetched_lines
,
62 run_stats
->st_shelved_lines
,
63 run_stats
->st_put_lines
,
64 run_stats
->st_put_unique_lines
,
65 run_stats
->st_not_unique_lines
,
66 run_stats
->st_input_files
,
67 run_stats
->st_merge_files
,
68 run_stats
->st_subfiles
,
69 run_stats
->st_tqs_calls
,
71 run_stats
->st_avail_mem
,
72 run_stats
->st_insert_full_input
,
73 run_stats
->st_insert_full_up
,
74 run_stats
->st_insert_full_down
,
75 run_stats
->st_tqs_calls
,
76 run_stats
->st_convert_reallocs
,
77 run_stats
->st_line_conversions
);
83 run_stats
->st_subfiles
++;
89 run_stats
->st_fetched_lines
++;
95 run_stats
->st_shelved_lines
++;
101 run_stats
->st_put_lines
++;
107 run_stats
->st_swaps
++;
111 stats_set_input_files(uint_t n
)
113 run_stats
->st_input_files
= n
;
117 stats_incr_input_files()
119 run_stats
->st_input_files
++;
123 stats_set_merge_files(uint_t n
)
125 run_stats
->st_merge_files
= n
;
129 stats_incr_merge_files()
131 run_stats
->st_merge_files
++;
135 stats_set_available_memory(uint64_t a
)
137 run_stats
->st_avail_mem
= a
;
141 stats_incr_insert_filled_input()
143 run_stats
->st_insert_full_input
++;
147 stats_incr_insert_filled_upward()
149 run_stats
->st_insert_full_up
++;
153 stats_incr_insert_filled_downward()
155 run_stats
->st_insert_full_down
++;
159 stats_incr_tqs_calls()
161 run_stats
->st_tqs_calls
++;
165 stats_incr_put_unique()
167 run_stats
->st_put_unique_lines
++;
171 stats_incr_not_unique()
173 run_stats
->st_not_unique_lines
++;
177 stats_incr_convert_reallocs()
179 run_stats
->st_convert_reallocs
++;
183 stats_incr_line_conversions()
185 run_stats
->st_line_conversions
++;