示例#1
0
        /// <summary>
        /// Creates an <seealso cref="EventContainer"/> from a <seealso cref="LogReceiver.LogEntry"/>. </summary>
        /// <param name="entry">  the LogEntry from which pid, tid, and time info is copied. </param>
        /// <param name="tag"> the event tag value </param>
        /// <param name="data"> the data of the EventContainer. </param>
        internal EventContainer(LogReceiver.LogEntry entry, int tag, object data)
        {
            getType(data);
            mTag  = tag;
            mData = data;

            pid  = entry.pid;
            tid  = entry.tid;
            sec  = entry.sec;
            nsec = entry.nsec;
        }
示例#2
0
        public EventContainer parse(LogReceiver.LogEntry entry)
        {
            if (entry.len < 4)
            {
                return(null);
            }

            int inOffset = 0;

            int tagValue = ArrayHelper.swap32bitFromArray(entry.data, inOffset);

            inOffset += 4;

            string tag = mTagMap[tagValue];

            if (tag == null)
            {
                Log.e("EventLogParser", string.Format("unknown tag number: {0:D}", tagValue));
            }

            List <object> list = new List <object>();

            if (parseBinaryEvent(entry.data, inOffset, list) == -1)
            {
                return(null);
            }

            object data;

            if (list.Count == 1)
            {
                data = list[0];
            }
            else
            {
                data = list.ToArray();
            }

            EventContainer @event = null;

            if (tagValue == GcEventContainer.GC_EVENT_TAG)
            {
                @event = new GcEventContainer(entry, tagValue, data);
            }
            else
            {
                @event = new EventContainer(entry, tagValue, data);
            }

            return(@event);
        }
示例#3
0
 internal GcEventContainer(LogReceiver.LogEntry entry, int tag, object data) : base(entry, tag, data)
 {
     init(data);
 }