diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2012-09-23 16:25:28 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2012-09-23 16:25:28 +0000 |
commit | 72ca9d0e614945d09322a2210cb43f2ec41554c6 (patch) | |
tree | eface143fd680320fa924d005e676b85f64e72e6 /epan/column-utils.c | |
parent | 9cde3e1a44e874ac5beb9e539dd4819a1281a096 (diff) |
Store pointers to previously displayed and captured packet, not nstime_t deltas.
This commit reduces size (from 144B to 128B on AMD64) of frame_data structure.
Part of bug 5821: Reduce per-packet memory requirements.
svn path=/trunk/; revision=45071
Diffstat (limited to 'epan/column-utils.c')
-rw-r--r-- | epan/column-utils.c | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/epan/column-utils.c b/epan/column-utils.c index a26950c4df..7737ec99dc 100644 --- a/epan/column-utils.c +++ b/epan/column-utils.c @@ -944,16 +944,20 @@ col_set_rel_time(const frame_data *fd, column_info *cinfo, const int col) static void col_set_delta_time(const frame_data *fd, column_info *cinfo, const int col) { + nstime_t del_cap_ts; + + frame_delta_abs_time(fd, fd->prev_cap, &del_cap_ts); + switch (timestamp_get_seconds_type()) { case TS_SECONDS_DEFAULT: - set_time_seconds(&fd->del_cap_ts, cinfo->col_buf[col]); + set_time_seconds(&del_cap_ts, cinfo->col_buf[col]); cinfo->col_expr.col_expr[col] = "frame.time_delta"; g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN); break; case TS_SECONDS_HOUR_MIN_SEC: - set_time_hour_min_sec(&fd->del_cap_ts, cinfo->col_buf[col]); + set_time_hour_min_sec(&del_cap_ts, cinfo->col_buf[col]); cinfo->col_expr.col_expr[col] = "frame.time_delta"; - set_time_seconds(&fd->del_cap_ts, cinfo->col_expr.col_expr_val[col]); + set_time_seconds(&del_cap_ts, cinfo->col_expr.col_expr_val[col]); break; default: g_assert_not_reached(); @@ -965,20 +969,25 @@ col_set_delta_time(const frame_data *fd, column_info *cinfo, const int col) static void col_set_delta_time_dis(const frame_data *fd, column_info *cinfo, const int col) { + nstime_t del_dis_ts; + if (!fd->flags.has_ts) { cinfo->col_buf[col][0] = '\0'; return; } + + frame_delta_abs_time(fd, fd->prev_dis, &del_dis_ts); + switch (timestamp_get_seconds_type()) { case TS_SECONDS_DEFAULT: - set_time_seconds(&fd->del_dis_ts, cinfo->col_buf[col]); + set_time_seconds(&del_dis_ts, cinfo->col_buf[col]); cinfo->col_expr.col_expr[col] = "frame.time_delta_displayed"; g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN); break; case TS_SECONDS_HOUR_MIN_SEC: - set_time_hour_min_sec(&fd->del_dis_ts, cinfo->col_buf[col]); + set_time_hour_min_sec(&del_dis_ts, cinfo->col_buf[col]); cinfo->col_expr.col_expr[col] = "frame.time_delta_displayed"; - set_time_seconds(&fd->del_dis_ts, cinfo->col_expr.col_expr_val[col]); + set_time_seconds(&del_dis_ts, cinfo->col_expr.col_expr_val[col]); break; default: g_assert_not_reached(); @@ -1165,12 +1174,16 @@ set_fd_time(frame_data *fd, gchar *buf) case TS_DELTA: if (fd->flags.has_ts) { + nstime_t del_cap_ts; + + frame_delta_abs_time(fd, fd->prev_cap, &del_cap_ts); + switch (timestamp_get_seconds_type()) { case TS_SECONDS_DEFAULT: - set_time_seconds(&fd->del_cap_ts, buf); + set_time_seconds(&del_cap_ts, buf); break; case TS_SECONDS_HOUR_MIN_SEC: - set_time_hour_min_sec(&fd->del_cap_ts, buf); + set_time_hour_min_sec(&del_cap_ts, buf); break; default: g_assert_not_reached(); @@ -1182,12 +1195,16 @@ set_fd_time(frame_data *fd, gchar *buf) case TS_DELTA_DIS: if (fd->flags.has_ts) { + nstime_t del_dis_ts; + + frame_delta_abs_time(fd, fd->prev_dis, &del_dis_ts); + switch (timestamp_get_seconds_type()) { case TS_SECONDS_DEFAULT: - set_time_seconds(&fd->del_dis_ts, buf); + set_time_seconds(&del_dis_ts, buf); break; case TS_SECONDS_HOUR_MIN_SEC: - set_time_hour_min_sec(&fd->del_dis_ts, buf); + set_time_hour_min_sec(&del_dis_ts, buf); break; default: g_assert_not_reached(); |