diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-04 13:51:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-04 13:51:29 -0400 |
commit | d46d0256cd030f196185078a4a8863563425b624 (patch) | |
tree | f72264009d1e979bd5f24b1b3e5fc70172446db9 /Documentation | |
parent | 8c52b6dcdd1994ad0d2672e43c8d975d5c8195c3 (diff) | |
parent | e46e7b77c9096eb2f4d6bcb9ca0b64c9338465ee (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge various fixes from Andrew Morton:
"10 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
mm, page_alloc: recalculate the preferred zoneref if the context can ignore memory policies
mm, page_alloc: reset zonelist iterator after resetting fair zone allocation policy
mm, oom_reaper: do not use siglock in try_oom_reaper()
mm, page_alloc: prevent infinite loop in buffered_rmqueue()
checkpatch: reduce git commit description style false positives
mm/z3fold.c: avoid modifying HEADLESS page and minor cleanup
memcg: add RCU locking around css_for_each_descendant_pre() in memcg_offline_kmem()
mm: check the return value of lookup_page_ext for all call sites
kdump: fix dmesg gdbmacro to work with record based printk
mm: fix overflow in vm_map_ram()
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/kdump/gdbmacros.txt | 93 |
1 files changed, 82 insertions, 11 deletions
diff --git a/Documentation/kdump/gdbmacros.txt b/Documentation/kdump/gdbmacros.txt index 35f6a982a0d5..220d0a80ca2c 100644 --- a/Documentation/kdump/gdbmacros.txt +++ b/Documentation/kdump/gdbmacros.txt | |||
@@ -170,21 +170,92 @@ document trapinfo | |||
170 | address the kernel panicked. | 170 | address the kernel panicked. |
171 | end | 171 | end |
172 | 172 | ||
173 | define dump_log_idx | ||
174 | set $idx = $arg0 | ||
175 | if ($argc > 1) | ||
176 | set $prev_flags = $arg1 | ||
177 | else | ||
178 | set $prev_flags = 0 | ||
179 | end | ||
180 | set $msg = ((struct printk_log *) (log_buf + $idx)) | ||
181 | set $prefix = 1 | ||
182 | set $newline = 1 | ||
183 | set $log = log_buf + $idx + sizeof(*$msg) | ||
173 | 184 | ||
174 | define dmesg | 185 | # prev & LOG_CONT && !(msg->flags & LOG_PREIX) |
175 | set $i = 0 | 186 | if (($prev_flags & 8) && !($msg->flags & 4)) |
176 | set $end_idx = (log_end - 1) & (log_buf_len - 1) | 187 | set $prefix = 0 |
188 | end | ||
189 | |||
190 | # msg->flags & LOG_CONT | ||
191 | if ($msg->flags & 8) | ||
192 | # (prev & LOG_CONT && !(prev & LOG_NEWLINE)) | ||
193 | if (($prev_flags & 8) && !($prev_flags & 2)) | ||
194 | set $prefix = 0 | ||
195 | end | ||
196 | # (!(msg->flags & LOG_NEWLINE)) | ||
197 | if (!($msg->flags & 2)) | ||
198 | set $newline = 0 | ||
199 | end | ||
200 | end | ||
201 | |||
202 | if ($prefix) | ||
203 | printf "[%5lu.%06lu] ", $msg->ts_nsec / 1000000000, $msg->ts_nsec % 1000000000 | ||
204 | end | ||
205 | if ($msg->text_len != 0) | ||
206 | eval "printf \"%%%d.%ds\", $log", $msg->text_len, $msg->text_len | ||
207 | end | ||
208 | if ($newline) | ||
209 | printf "\n" | ||
210 | end | ||
211 | if ($msg->dict_len > 0) | ||
212 | set $dict = $log + $msg->text_len | ||
213 | set $idx = 0 | ||
214 | set $line = 1 | ||
215 | while ($idx < $msg->dict_len) | ||
216 | if ($line) | ||
217 | printf " " | ||
218 | set $line = 0 | ||
219 | end | ||
220 | set $c = $dict[$idx] | ||
221 | if ($c == '\0') | ||
222 | printf "\n" | ||
223 | set $line = 1 | ||
224 | else | ||
225 | if ($c < ' ' || $c >= 127 || $c == '\\') | ||
226 | printf "\\x%02x", $c | ||
227 | else | ||
228 | printf "%c", $c | ||
229 | end | ||
230 | end | ||
231 | set $idx = $idx + 1 | ||
232 | end | ||
233 | printf "\n" | ||
234 | end | ||
235 | end | ||
236 | document dump_log_idx | ||
237 | Dump a single log given its index in the log buffer. The first | ||
238 | parameter is the index into log_buf, the second is optional and | ||
239 | specified the previous log buffer's flags, used for properly | ||
240 | formatting continued lines. | ||
241 | end | ||
177 | 242 | ||
178 | while ($i < logged_chars) | 243 | define dmesg |
179 | set $idx = (log_end - 1 - logged_chars + $i) & (log_buf_len - 1) | 244 | set $i = log_first_idx |
245 | set $end_idx = log_first_idx | ||
246 | set $prev_flags = 0 | ||
180 | 247 | ||
181 | if ($idx + 100 <= $end_idx) || \ | 248 | while (1) |
182 | ($end_idx <= $idx && $idx + 100 < log_buf_len) | 249 | set $msg = ((struct printk_log *) (log_buf + $i)) |
183 | printf "%.100s", &log_buf[$idx] | 250 | if ($msg->len == 0) |
184 | set $i = $i + 100 | 251 | set $i = 0 |
185 | else | 252 | else |
186 | printf "%c", log_buf[$idx] | 253 | dump_log_idx $i $prev_flags |
187 | set $i = $i + 1 | 254 | set $i = $i + $msg->len |
255 | set $prev_flags = $msg->flags | ||
256 | end | ||
257 | if ($i == $end_idx) | ||
258 | loop_break | ||
188 | end | 259 | end |
189 | end | 260 | end |
190 | end | 261 | end |