Print this page
9709 Remove support for BZIP2 from dump
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/dumphdr.h
+++ new/usr/src/uts/common/sys/dumphdr.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
23 + * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
23 24 * Copyright (c) 2016 by Delphix. All rights reserved.
24 25 */
25 26
26 27 #ifndef _SYS_DUMPHDR_H
27 28 #define _SYS_DUMPHDR_H
28 29
29 30 #include <sys/types.h>
30 31 #include <sys/param.h>
31 32 #include <sys/utsname.h>
32 33 #include <sys/log.h>
33 34
34 35 #ifdef __cplusplus
35 36 extern "C" {
36 37 #endif
37 38
38 39 /*
39 40 * The dump header describes the contents of a crash dump. Two headers
40 41 * are written out: one at the beginning of the dump, and the other at
41 42 * the very end of the dump device. The terminal header is at a known
42 43 * location (end of device) so we can always find it. The initial header
43 44 * is redundant, but helps savecore(1M) determine whether the dump has been
44 45 * overwritten by swap activity. See dumpadm(1M) for dump configuration.
45 46 */
46 47 #define DUMP_MAGIC 0xdefec8edU /* dump magic number */
47 48 #define DUMP_VERSION 10 /* version of this dumphdr */
48 49 #define DUMP_WORDSIZE (sizeof (long) * NBBY) /* word size (32 or 64) */
49 50 #define DUMP_PANICSIZE 200 /* Max panic string copied */
50 51 #define DUMP_COMPRESS_RATIO 2 /* conservative; usually 2.5+ */
51 52 #define DUMP_OFFSET 65536 /* pad at start/end of dev */
52 53 #define DUMP_LOGSIZE (2 * LOG_HIWAT) /* /dev/log message save area */
53 54 #define DUMP_ERPTSIZE (P2ROUNDUP( \
54 55 (ERPT_DATA_SZ / 2) * \
55 56 (ERPT_EVCH_MAX + \
56 57 ERPT_MAX_ERRS * ERPT_HIWAT), \
57 58 DUMP_OFFSET)) /* ereport save area */
58 59 #define DUMP_SUMMARYSIZE (P2ROUNDUP( \
59 60 (STACK_BUF_SIZE + \
60 61 sizeof (summary_dump_t) + 1024), \
61 62 DUMP_OFFSET)) /* summary save area */
62 63
63 64 typedef struct dumphdr {
64 65 uint32_t dump_magic; /* magic number */
65 66 uint32_t dump_version; /* version number */
66 67 uint32_t dump_flags; /* flags; see below */
67 68 uint32_t dump_wordsize; /* 32 or 64 */
68 69 offset_t dump_start; /* starting offset on dump device */
69 70 offset_t dump_ksyms; /* offset of compressed symbol table */
70 71 offset_t dump_pfn; /* offset of pfn table for all pages */
71 72 offset_t dump_map; /* offset of page translation map */
72 73 offset_t dump_data; /* offset of actual dump data */
73 74 struct utsname dump_utsname; /* copy of utsname structure */
74 75 char dump_platform[SYS_NMLN]; /* platform name (uname -i) */
75 76 char dump_panicstring[DUMP_PANICSIZE]; /* copy of panicstr */
76 77 time_t dump_crashtime; /* time of crash */
77 78 long dump_pageshift; /* log2(pagesize) */
78 79 long dump_pagesize; /* pagesize */
79 80 long dump_hashmask; /* page translation hash mask */
80 81 long dump_nvtop; /* number of vtop table entries */
81 82 pgcnt_t dump_npages; /* number of data pages */
82 83 size_t dump_ksyms_size; /* kernel symbol table size */
83 84 size_t dump_ksyms_csize; /* compressed symbol table size */
84 85 uint32_t dump_fm_panic; /* initiated from fm subsystems */
85 86 char dump_uuid[36 + 1]; /* os image uuid */
86 87 } dumphdr_t;
87 88
88 89 /*
89 90 * Values for dump_flags
90 91 */
91 92 #define DF_VALID 0x00000001 /* Dump is valid (savecore clears) */
92 93 #define DF_COMPLETE 0x00000002 /* All pages present as configured */
93 94 #define DF_LIVE 0x00000004 /* Dump was taken on a live system */
94 95 #define DF_COMPRESSED 0x00000008 /* Dump is compressed */
95 96 #define DF_KERNEL 0x00010000 /* Contains kernel pages only */
96 97 #define DF_ALL 0x00020000 /* Contains all pages */
97 98 #define DF_CURPROC 0x00040000 /* Contains kernel + cur proc pages */
98 99 #define DF_CONTENT 0xffff0000 /* The set of all dump content flags */
99 100
100 101 /*
101 102 * Dump translation map hash table entry.
102 103 */
103 104 typedef struct dump_map {
104 105 offset_t dm_first;
105 106 offset_t dm_next;
106 107 offset_t dm_data;
107 108 struct as *dm_as;
108 109 uintptr_t dm_va;
109 110 } dump_map_t;
110 111
111 112 /*
112 113 * Dump translation map hash function.
113 114 */
114 115 #define DUMP_HASH(dhp, as, va) \
115 116 ((((uintptr_t)(as) >> 3) + ((va) >> (dhp)->dump_pageshift)) & \
116 117 (dhp)->dump_hashmask)
117 118
118 119 /*
119 120 * Encoding of the csize word used to provide meta information
120 121 * between dumpsys and savecore.
121 122 *
122 123 * tag size
123 124 * 1-4095 1..dump_maxcsize stream block
124 125 * 0 1..pagesize one lzjb page
125 126 * 0 0 marks end of data
126 127 */
127 128 typedef uint32_t dumpcsize_t;
128 129
129 130 #define DUMP_MAX_TAG (0xfffU)
130 131 #define DUMP_MAX_CSIZE (0xfffffU)
131 132 #define DUMP_SET_TAG(w, v) (((w) & DUMP_MAX_CSIZE) | ((v) << 20))
132 133 #define DUMP_GET_TAG(w) (((w) >> 20) & DUMP_MAX_TAG)
133 134 #define DUMP_SET_CSIZE(w, v) \
134 135 (((w) & (DUMP_MAX_TAG << 20)) | ((v) & DUMP_MAX_CSIZE))
135 136 #define DUMP_GET_CSIZE(w) ((w) & DUMP_MAX_CSIZE)
136 137
137 138 typedef struct dumpstreamhdr {
138 139 char stream_magic[8]; /* "StrmHdr" */
139 140 pgcnt_t stream_pagenum; /* starting pfn */
140 141 pgcnt_t stream_npages; /* uncompressed size */
141 142 } dumpstreamhdr_t;
142 143
143 144 #define DUMP_STREAM_MAGIC "StrmHdr"
144 145
145 146 /* The number of helpers is limited by the number of stream tags. */
146 147 #define DUMP_MAX_NHELPER DUMP_MAX_TAG
147 148
148 149 /*
149 150 * The dump data header is placed after the dumphdr in the compressed
150 151 * image. It is not needed after savecore runs and the data pages have
151 152 * been decompressed.
152 153 */
153 154 typedef struct dumpdatahdr {
154 155 uint32_t dump_datahdr_magic; /* data header presence */
155 156 uint32_t dump_datahdr_version; /* data header version */
156 157 uint64_t dump_data_csize; /* compressed data size */
↓ open down ↓ |
124 lines elided |
↑ open up ↑ |
157 158 uint32_t dump_maxcsize; /* compressed data max block size */
158 159 uint32_t dump_maxrange; /* max number of pages per range */
159 160 uint16_t dump_nstreams; /* number of compression streams */
160 161 uint16_t dump_clevel; /* compression level (0-9) */
161 162 uint32_t dump_metrics; /* size of metrics data */
162 163 } dumpdatahdr_t;
163 164
164 165 #define DUMP_DATAHDR_MAGIC ('d' << 24 | 'h' << 16 | 'd' << 8 | 'r')
165 166
166 167 #define DUMP_DATAHDR_VERSION 1
168 +#define DUMP_CLEVEL_SERIAL 0 /* single-threaded lzjb compression */
167 169 #define DUMP_CLEVEL_LZJB 1 /* parallel lzjb compression */
168 -#define DUMP_CLEVEL_BZIP2 2 /* parallel bzip2 level 1 */
169 170
170 171 #ifdef _KERNEL
171 172
172 173 extern kmutex_t dump_lock;
173 174 extern struct vnode *dumpvp;
174 175 extern u_offset_t dumpvp_size;
175 176 extern struct dumphdr *dumphdr;
176 177 extern int dump_conflags;
177 178 extern char *dumppath;
178 179
179 180 extern int dump_timeout;
180 181 extern int dump_timeleft;
181 182 extern int dump_ioerr;
182 183
183 184 extern int dumpinit(struct vnode *, char *, int);
184 185 extern void dumpfini(void);
185 186 extern void dump_resize(void);
186 187 extern void dump_page(pfn_t);
187 188 extern void dump_addpage(struct as *, void *, pfn_t);
188 189 extern void dumpsys(void);
189 190 extern void dumpsys_helper(void);
190 191 extern void dumpsys_helper_nw(void);
191 192 extern void dump_messages(void);
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
192 193 extern void dump_ereports(void);
193 194 extern void dumpvp_write(const void *, size_t);
194 195 extern int dumpvp_resize(void);
195 196 extern int dump_plat_addr(void);
196 197 extern void dump_plat_pfn(void);
197 198 extern int dump_plat_data(void *);
198 199 extern int dump_set_uuid(const char *);
199 200 extern const char *dump_get_uuid(void);
200 201
201 202 /*
202 - * Define a CPU count threshold that determines when to employ
203 - * bzip2. This value is defined per-platform.
204 - */
205 -extern uint_t dump_plat_mincpu_default;
206 -
207 -#define DUMP_PLAT_SUN4U_MINCPU 0
208 -#define DUMP_PLAT_SUN4U_OPL_MINCPU 0
209 -#define DUMP_PLAT_SUN4V_MINCPU 0
210 -#define DUMP_PLAT_X86_64_MINCPU 0
211 -#define DUMP_PLAT_X86_32_MINCPU 0
212 -
213 -/*
214 - * Override the per-platform default by setting this variable with
215 - * /etc/system. The value 0 disables parallelism, and the old format
216 - * dump is produced.
217 - */
218 -extern uint_t dump_plat_mincpu;
219 -
220 -/*
221 203 * Pages may be stolen at dump time. Prevent the pages from ever being
222 204 * allocated while dump is running.
223 205 */
224 206 #define IS_DUMP_PAGE(pp) (dump_check_used && dump_test_used((pp)->p_pagenum))
225 207
226 208 extern int dump_test_used(pfn_t);
227 209 extern int dump_check_used;
228 210
229 211 #endif /* _KERNEL */
230 212
231 213 #ifdef __cplusplus
232 214 }
233 215 #endif
234 216
235 217 #endif /* _SYS_DUMPHDR_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX