[sysprof] capture-reader: fix byte swap of frame info
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] capture-reader: fix byte swap of frame info
- Date: Wed, 14 Feb 2018 00:34:52 +0000 (UTC)
commit 0ec2c127ea3b6e8cda9460284be2a952100cd50b
Author: Christian Hergert <chergert redhat com>
Date: Tue Feb 13 16:34:41 2018 -0800
capture-reader: fix byte swap of frame info
If we are swapping between endianness, we were miss swapping various fields
and they'd all end up with the swapped len value.
lib/capture/sp-capture-reader.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/lib/capture/sp-capture-reader.c b/lib/capture/sp-capture-reader.c
index a361401..1ee8540 100644
--- a/lib/capture/sp-capture-reader.c
+++ b/lib/capture/sp-capture-reader.c
@@ -176,9 +176,9 @@ sp_capture_reader_bswap_frame (SpCaptureReader *self,
if (G_UNLIKELY (self->endian != G_BYTE_ORDER))
{
frame->len = GUINT16_SWAP_LE_BE (frame->len);
- frame->cpu = GUINT16_SWAP_LE_BE (frame->len);
- frame->pid = GUINT32_SWAP_LE_BE (frame->len);
- frame->time = GUINT64_SWAP_LE_BE (frame->len);
+ frame->cpu = GUINT16_SWAP_LE_BE (frame->cpu);
+ frame->pid = GUINT32_SWAP_LE_BE (frame->pid);
+ frame->time = GUINT64_SWAP_LE_BE (frame->time);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]