Lines Matching defs:file
4 * you may not use this file except in compliance with the License.
202 // open file "trace_marker".
212 HILOG_ERROR(LOG_CORE, "open trace file %{public}s failed: %{public}d", debugFile.c_str(), errno);
215 HILOG_ERROR(LOG_CORE, "open trace file %{public}s failed: %{public}d", traceFile.c_str(), errno);
288 bool GetProcData(const char* file, char* buffer, const size_t bufferSize)
290 FILE* fp = fopen(file, "r");
293 std::string errLogStr = std::string(__func__) + ": open " + std::string(file) + " falied";
301 std::string errLogStr = std::string(__func__) + ": fgets " + std::string(file) + " falied";
308 std::string errLogStr = std::string(__func__) + ": fclose " + std::string(file) + " falied";
368 char file[size] = {0};
369 auto ret = snprintf_s(file, sizeof(file), sizeof(file) - 1, "%s_%04d%02d%02d_%02d%02d%02d.trace", g_appName,
372 HILOG_ERROR(LOG_CORE, "Format file failed, %{public}d", errno);
376 destFileName += std::string(file);
377 fileName = PHYSICAL_PATH + std::string(g_appName) + "/trace/" + std::string(file);
399 lseek(g_appFd, used, SEEK_SET); // Reserve space to write the file header.
419 // The remaining space is insufficient to cache the data. Write the data to the file.
456 std::string file = "/proc/self/task/" + tidStr + "/comm";
458 if (!GetProcData(file.c_str(), comm, NAME_NORMAL_LEN)) {
529 // 2 apply new memory and directly write file.
697 void SetGetProcData(const char* file)
699 GetProcData(file, g_appName, NAME_NORMAL_LEN);
1093 lseek(g_appFd, 0, SEEK_SET); // Move the write pointer to populate the file header.