Пример #1
0
    def request_age_ms(cls, request):
        """
        Returns the age of the request in milliseconds

        This method returns the difference between the current time
        (jiffies) and the request's start_time, in milliseconds.

        Args:
            request(gdb.Value<struct request>): The struct request used
                to determine age

        Returns:
            long: Difference between the request's start_time and
                current jiffies in milliseconds.
        """
        return kernel.jiffies_to_msec(kernel.jiffies - request['start_time'])
Пример #2
0
from crash.subsystem.storage import gendisk_name
from crash.subsystem.storage.block import for_each_request_in_queue
from crash.types.list import list_for_each_entry
from crash.util import get_symbol_value
from crash.cache.syscache import kernel, jiffies_to_msec

empty = []

flush_end_io = get_symbol_value('flush_end_io')

for b in for_each_disk():
    name = gendisk_name(b)
    count = 0
    for r in for_each_request_in_queue(b['queue']):
        age_in_jiffies = kernel.jiffies - r['start_time']
        age = float(int(kernel.jiffies_to_msec(age_in_jiffies))) / 1000
        if count == 0:
            print name
        if r['bio']:
            print "{}: {:x} request: age={}s, bio chain".format(
                count, int(r.address), age, int(r['bio']))
            n = 0
            for entry in for_each_bio_in_stack(r['bio']):
                print "  {}: {}".format(n, entry['description'])
                n += 1
        else:
            if r['end_io'] == flush_end_io:
                print "{}: {:x} request: age={}s, pending flush request".format(
                    count, int(r.address), age)
            else:
                print "{}: {:x} request: start={}, undecoded".format(
Пример #3
0
 def request_age_ms(cls, request):
     return kernel.jiffies_to_msec(kernel.jiffies - request['start_time'])