4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://floralicense.org/license/
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
40 flag.StringVar(&infile, "i", "stripped.drv", "input drv file")
41 flag.StringVar(&glob, "r", "", "model search pattern")
42 flag.StringVar(&cpuprofile, "p", "", "write cpu profile to file")
49 f, err := os.Create(cpuprofile)
53 pprof.StartCPUProfile(f)
54 defer pprof.StopCPUProfile()
62 buf, err := drv.Read(infile)
68 model, err := drv.Find_model(buf, glob)
75 outfile = glob + ".drv"
78 fd, err := os.Create(outfile)
83 defer os.Remove(outfile)
86 _, err = fd.Write([]byte(model))
92 cmd := exec.Command("ppdc", "-d", ".", outfile)
95 fmt.Println("ppdc:", err)