1*efe51d0cSJohn Levon#!/bin/bash
2*efe51d0cSJohn Levon
3*efe51d0cSJohn Levondb_file=$1
4*efe51d0cSJohn Levon
5*efe51d0cSJohn LevonIFS="|"
6*efe51d0cSJohn Levonecho "select count(function), function from function_ptr group by function;" | \
7*efe51d0cSJohn Levon    sqlite3 $db_file  | sort -n | tail -n 100 | \
8*efe51d0cSJohn Levon
9*efe51d0cSJohn Levonwhile read cnt func ; do
10*efe51d0cSJohn Levon    if [ $cnt -lt 200 ] ; then
11*efe51d0cSJohn Levon        continue
12*efe51d0cSJohn Levon    fi
13*efe51d0cSJohn Levon    echo "delete from function_ptr where function = '$func';" | sqlite3 $db_file
14*efe51d0cSJohn Levondone
15