diff options
author | Dave Airlie <airlied@redhat.com> | 2013-10-22 07:32:40 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-10-22 07:32:40 +0100 |
commit | 3bcec5f076688c58436a6c354f5b94eef16469da (patch) | |
tree | 6e50e1c03d52bffbd17b16dd6b153a428f0b9e7c /tools/perf/util/header.c | |
parent | drm: Pad drm_mode_get_connector to 64-bit boundary (diff) | |
parent | drm/i915: Disable GGTT PTEs on GEN6+ suspend (diff) | |
download | linux-dev-3bcec5f076688c58436a6c354f5b94eef16469da.tar.xz linux-dev-3bcec5f076688c58436a6c354f5b94eef16469da.zip |
Merge tag 'drm-intel-fixes-2013-10-21' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes
Just an lvds clock gating fix and a pte clearing hack for hsw to avoid
memory corruption when hibernating - something doesn't seem to switch off
properly, we're still investigating.
* tag 'drm-intel-fixes-2013-10-21' of git://people.freedesktop.org/~danvet/drm-intel: (96 commits)
drm/i915: Disable GGTT PTEs on GEN6+ suspend
drm/i915: Make PTE valid encoding optional
drm/i915: disable LVDS clock gating on CPT v2
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r-- | tools/perf/util/header.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index ce69901176d8..c3e5a3b817ab 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2768,6 +2768,18 @@ int perf_session__read_header(struct perf_session *session) if (perf_file_header__read(&f_header, header, fd) < 0) return -EINVAL; + /* + * Sanity check that perf.data was written cleanly; data size is + * initialized to 0 and updated only if the on_exit function is run. + * If data size is still 0 then the file contains only partial + * information. Just warn user and process it as much as it can. + */ + if (f_header.data.size == 0) { + pr_warning("WARNING: The %s file's data size field is 0 which is unexpected.\n" + "Was the 'perf record' command properly terminated?\n", + session->filename); + } + nr_attrs = f_header.attrs.size / f_header.attr_size; lseek(fd, f_header.attrs.offset, SEEK_SET); |