msm: kgsl: Use the correct timestamp for the snapshot

The snapshot timestamp is currently based on wall time which makes
it very difficult to debug against a kernel log based on boot time.
It doesn't help matters that the snapshot timestamp is output in
human unfriendly hex.  Use boot time instead of wall time for the
snapshot value and print it out in decimal.

Change-Id: Ic0dedbadf9b7d799a3cb4d5917787bccd350c90a
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
This commit is contained in:
Jordan Crouse
2013-02-14 14:11:44 -07:00
committed by Iliyan Malchev
parent 0f49addefa
commit 12fac3c112

View File

@@ -518,6 +518,7 @@ int kgsl_device_snapshot(struct kgsl_device *device, int hang)
struct kgsl_snapshot_header *header = device->snapshot;
int remain = device->snapshot_maxsize - sizeof(*header);
void *snapshot;
struct timespec boot;
/*
* The first hang is always the one we are interested in. To
@@ -559,7 +560,13 @@ int kgsl_device_snapshot(struct kgsl_device *device, int hang)
snapshot = device->ftbl->snapshot(device, snapshot, &remain,
hang);
device->snapshot_timestamp = get_seconds();
/*
* The timestamp is the seconds since boot so it is easier to match to
* the kernel log
*/
getboottime(&boot);
device->snapshot_timestamp = get_seconds() - boot.tv_sec;
device->snapshot_size = (int) (snapshot - device->snapshot);
/* Freeze the snapshot on a hang until it gets read */
@@ -654,7 +661,7 @@ done:
/* Show the timestamp of the last collected snapshot */
static ssize_t timestamp_show(struct kgsl_device *device, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%x\n", device->snapshot_timestamp);
return snprintf(buf, PAGE_SIZE, "%d\n", device->snapshot_timestamp);
}
/* manually trigger a new snapshot to be collected */