Lines Matching refs:write

34    def write(self, *args):
38 self.file.write(text.rstrip() + "\n")
90 parser.add_argument("--header", help="Header file to write", required=True)
91 parser.add_argument("--code", help="C file to write", required=True)
133 h.write(copyright)
134 h.write(textwrap.dedent("""\
142 c.write(copyright)
143 c.write("#include \"" + os.path.basename(args.header) + "\"")
144 c.write(textwrap.dedent("""\
150 c.write(textwrap.dedent("""
158 c.write("STATIC_ASSERT(%u <= PAN_PERF_MAX_CATEGORIES);" % n_categories)
162 c.write("STATIC_ASSERT(%u <= PAN_PERF_MAX_COUNTERS);" % category_counters_count)
166 c.write("}\n")
170 c.write("\nconst struct panfrost_perf_config %s = {" % current_struct_name)
173 c.write(".name = \"%s\"," % prod.name)
174 c.write(".n_categories = %u," % len(prod.categories))
176 c.write(".categories = {")
184 c.write("{")
186 c.write(".name = \"%s\"," % (category.name))
187 c.write(".n_counters = %u," % (len(category.counters)))
188 c.write(".counters = {")
195 c.write("{")
198 c.write(".name = \"%s\"," % (counter.name))
199 c.write(".desc = \"%s\"," % (counter.desc.replace("\\", "\\\\")))
200 c.write(".symbol_name = \"%s\"," % (counter.underscore_name))
201 c.write(".units = PAN_PERF_COUNTER_UNITS_%s," % (counter.units.upper()))
202 c.write(".offset = %u," % (counter.offset))
203 c.write(".category_index = %u," % i)
206 c.write("}, // counter")
211 c.write("}, // counters")
214 c.write("}, // category")
217 c.write("}, // categories")
220 c.write("}; // %s\n" % current_struct_name)
222 h.write("extern const struct panfrost_perf_config * panfrost_perf_configs[%u];\n" % len(prods))
224 c.write("\nconst struct panfrost_perf_config * panfrost_perf_configs[] = {")
227 c.write("&panfrost_perf_config_%s," % prod.id)
229 c.write("};")
231 h.write("\n#endif // PAN_PERF_METRICS_H")