ftrace: disable tracing for hibernation

In accordance with commit f42ac38c59e0a03d6da0c24a63fb211393f484b0
("ftrace: disable tracing for suspend to ram"), disable tracing
around the suspend code in hibernation code paths.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Rafael J. Wysocki and committed by Linus Torvalds 41108eb1 b09331e5

+10 -3
+10 -3
kernel/power/disk.c
··· 21 21 #include <linux/console.h> 22 22 #include <linux/cpu.h> 23 23 #include <linux/freezer.h> 24 + #include <linux/ftrace.h> 24 25 25 26 #include "power.h" 26 27 ··· 256 255 257 256 int hibernation_snapshot(int platform_mode) 258 257 { 259 - int error; 258 + int error, ftrace_save; 260 259 261 260 /* Free memory before shutting down devices. */ 262 261 error = swsusp_shrink_memory(); ··· 268 267 goto Close; 269 268 270 269 suspend_console(); 270 + ftrace_save = __ftrace_enabled_save(); 271 271 error = device_suspend(PMSG_FREEZE); 272 272 if (error) 273 273 goto Recover_platform; ··· 298 296 Resume_devices: 299 297 device_resume(in_suspend ? 300 298 (error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE); 299 + __ftrace_enabled_restore(ftrace_save); 301 300 resume_console(); 302 301 Close: 303 302 platform_end(platform_mode); ··· 369 366 370 367 int hibernation_restore(int platform_mode) 371 368 { 372 - int error; 369 + int error, ftrace_save; 373 370 374 371 pm_prepare_console(); 375 372 suspend_console(); 373 + ftrace_save = __ftrace_enabled_save(); 376 374 error = device_suspend(PMSG_QUIESCE); 377 375 if (error) 378 376 goto Finish; ··· 388 384 platform_restore_cleanup(platform_mode); 389 385 device_resume(PMSG_RECOVER); 390 386 Finish: 387 + __ftrace_enabled_restore(ftrace_save); 391 388 resume_console(); 392 389 pm_restore_console(); 393 390 return error; ··· 401 396 402 397 int hibernation_platform_enter(void) 403 398 { 404 - int error; 399 + int error, ftrace_save; 405 400 406 401 if (!hibernation_ops) 407 402 return -ENOSYS; ··· 416 411 goto Close; 417 412 418 413 suspend_console(); 414 + ftrace_save = __ftrace_enabled_save(); 419 415 error = device_suspend(PMSG_HIBERNATE); 420 416 if (error) { 421 417 if (hibernation_ops->recover) ··· 451 445 hibernation_ops->finish(); 452 446 Resume_devices: 453 447 device_resume(PMSG_RESTORE); 448 + __ftrace_enabled_restore(ftrace_save); 454 449 resume_console(); 455 450 Close: 456 451 hibernation_ops->end();