create_dmesg_entries_for_each_test.awk revision 660301278d2368f642091a91f35ad79abf9ff306
1660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper#!/usr/bin/awk -f 2660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# 3660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# Script for adding necessary dmesg clear/capture calls before executing 4660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# commands. 5660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# 6660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# Copyright (C) 2012, Linux Test Project. 7660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# 8660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# This program is free software; you can redistribute it and/or modify 9660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# it under the terms of the GNU General Public License as published by 10660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# the Free Software Foundation; either version 2 of the License, or 11660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# (at your option) any later version. 12660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# 13660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# This program is distributed in the hope that it will be useful, 14660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# but WITHOUT ANY WARRANTY; without even the implied warranty of 15660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# GNU General Public License for more details. 17660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# 18660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# You should have received a copy of the GNU General Public License along 19660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# with this program; if not, write to the Free Software Foundation, Inc., 20660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 21660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# 22660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# Garrett Cooper, April 2012 23660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper# 24660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper 25660301278d2368f642091a91f35ad79abf9ff306Garrett CooperNF && ! /^#/ { 26660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper s = $1 "__with_dmesg_entry dmesg -c 1>/dev/null 2>&1;" 27660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper for (i = 2; i <= NF; i++) { 28660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper s = s " " $i 29660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper } 30660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper s = s "; dmesg > " DMESG_DIR "/" $1 ".dmesg.log" 31660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper print s 32660301278d2368f642091a91f35ad79abf9ff306Garrett Cooper} 33