Changes between Version 2 and Version 3 of 802.11/wlan_exp/log/util


Ignore:
Timestamp:
Mar 22, 2014, 5:02:44 PM (10 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 802.11/wlan_exp/log/util

    v2 v3  
    11Future home of wlan_exp_log.log_util documentation.
    22
    3 == Log Index Filtering ==
    4 The {{{filter_log_index}}} method applies filters to a raw log index, generating a new dictionary suitable for use by downstream utilities.
     3== Log Index Generation ==
     4The {{{gen_log_data_index}}} method generates an index of log entries in a given log data buffer. The log data index can be generated when the log data is stored and is used to quickly summarize log contents and to access individual entries without re-parsing the full log data buffer.
     5
     6The log data index is represented as a dictionary. Each dictionary entry has an entry type ID as its key and a list of byte indexes as its value.
     7
     8For example, consider the log data illustrated below:
     9
     10[[Image(wiki:802.11/files:wlan_exp_log_layout.png, width=500)]]
     11
     12The corresponding log index would be the dictionary below (where the {{{TYPE_ID_}}} values are the integer entry type IDs contained in the log data):
     13{{{#!python
     14{
     15  TYPE_ID_RED:    [8, 88],
     16  TYPE_ID_GREEN:[36, 74],
     17  TYPE_ID_YLW:    [56,]
     18}
     19}}}
     20
     21'''Important''': the log data index can be generated without any knowledge of the meaning of each log entry type. The index is keyed by the integer log entry type IDs contained in the log data itself. The log data index and log data always correspond 1:1 - once generated, the log data index can be saved alongside the log data and re-used as needed. Refer to the {{{log_data_to_hdf5}}} utility for an example implementation.
     22
     23== Log Index Translation & Filtering ==
     24The {{{filter_log_index}}} method applies filters to a log data index, generating a new dictionary suitable for use by downstream utilities. This utility has two functions:
     25 * Index key translation: the integer entry type IDs are translated into instances of the WlanExpLogEntryType object that represents the underlying entry type
     26 * Entry type filtering: the input index can be filtered, with individual entry types included, excluded and merged as required by the experiment
    527
    628A few example uses of {{{filter_log_index}}}:
     
    830import warpnet.wlan_exp_log.log_util as log_util
    931
    10 #No filtering, just map entry_type_id values (log_index_raw keys) to entry type classes (log_index keys)
    11 log_index = log_util.filter_log_index(log_index_raw)
     32#log_data_index is a dictionary returned by gen_log_data_index
     33
     34#No filtering, just map entry_type_id values (log_data_index keys) to entry type classes (log_index keys)
     35log_index = log_util.filter_log_index(log_data_index)
    1236
    1337#Create index with only RX_OFDM entries
    14 log_index = log_util.filter_log_index(log_index_raw, include_only=['RX_OFDM'])
     38log_index = log_util.filter_log_index(log_data_index, include_only=['RX_OFDM'])
    1539
    1640#Create index with only RX_OFDM and TX entries
    17 log_index = log_util.filter_log_index(log_index_raw, include_only=['RX_OFDM', 'TX'])
     41log_index = log_util.filter_log_index(log_data_index, include_only=['RX_OFDM', 'TX'])
    1842
    1943#Create index for type RX_ALL composed of all RX_OFDM and RX_DSSS entries
    20 log_index = log_util.filter_log_index(log_index_raw, merge={'RX_ALL':['RX_OFDM', 'RX_DSSS']})
     44log_index = log_util.filter_log_index(log_data_index, merge={'RX_ALL':['RX_OFDM', 'RX_DSSS']})
    2145
    2246#Create index for all TX and RX entries, with RX_OFDM and RX_DSSS entries merged into RX_ALL
    23 log_index = log_util.filter_log_index(log_index_raw, include_only=['RX_ALL', 'TX'], merge={'RX_ALL':['RX_OFDM', 'RX_DSSS']})
     47log_index = log_util.filter_log_index(log_data_index, include_only=['RX_ALL', 'TX'], merge={'RX_ALL':['RX_OFDM', 'RX_DSSS']})
    2448}}}