Got rid of weak imports of libpenergy and libpsample because we are already requiring...
authorHan Ming Ong <hanming@apple.com>
Tue, 27 Feb 2018 17:53:38 +0000 (17:53 +0000)
committerHan Ming Ong <hanming@apple.com>
Tue, 27 Feb 2018 17:53:38 +0000 (17:53 +0000)
Reviewer: Jason Molenda
llvm-svn: 326213

lldb/tools/debugserver/debugserver.xcodeproj/project.pbxproj
lldb/tools/debugserver/source/MacOSX/MachTask.mm

index d7382c3..b7e90a1 100644 (file)
                                LLDB_ENERGY_CFLAGS = "";
                                "LLDB_ENERGY_CFLAGS[sdk=macosx*]" = "-DLLDB_ENERGY";
                                LLDB_ENERGY_LFLAGS = "";
-                               "LLDB_ENERGY_LFLAGS[sdk=macosx*]" = "-weak-lpmenergy -weak-lpmsample";
+                               "LLDB_ENERGY_LFLAGS[sdk=macosx*]" = "-lpmenergy -lpmsample";
                                LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
                                LLDB_ZLIB_LDFLAGS = "-lz";
                                OTHER_CFLAGS = (
                                SKIP_INSTALL = YES;
                                "SKIP_INSTALL[sdk=iphoneos*]" = NO;
                                STRIP_INSTALLED_PRODUCT = YES;
-                               USER_HEADER_SEARCH_PATHS = (
-                                       ./source,
-                                       ../../source,
-                                       "$(DERIVED_SOURCES_DIR)",
-                                       ../../include,
-                               );
+                               USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
                                ZERO_LINK = NO;
                        };
                        name = BuildAndIntegration;
                                LLDB_ENERGY_CFLAGS = "";
                                "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
                                LLDB_ENERGY_LFLAGS = "";
-                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-lpmenergy -lpmsample";
                                LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
                                LLDB_ZLIB_LDFLAGS = "-lz";
                                OTHER_CFLAGS = (
                                "SDKROOT[arch=x86_64]" = macosx;
                                "SDKROOT[arch=x86_64h]" = macosx;
                                SKIP_INSTALL = YES;
-                               USER_HEADER_SEARCH_PATHS = (
-                                       ./source,
-                                       ../../source,
-                                       "$(DERIVED_SOURCES_DIR)",
-                                       ../../include,
-                               );
+                               USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
                                ZERO_LINK = NO;
                        };
                        name = Debug;
                                LLDB_ENERGY_CFLAGS = "";
                                "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
                                LLDB_ENERGY_LFLAGS = "";
-                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-lpmenergy -lpmsample";
                                LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
                                LLDB_ZLIB_LDFLAGS = "-lz";
                                OTHER_CFLAGS = (
                                "SDKROOT[arch=x86_64]" = macosx;
                                "SDKROOT[arch=x86_64h]" = macosx;
                                SKIP_INSTALL = YES;
-                               USER_HEADER_SEARCH_PATHS = (
-                                       ./source,
-                                       ../../source,
-                                       "$(DERIVED_SOURCES_DIR)",
-                                       ../../include,
-                               );
+                               USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
                                ZERO_LINK = NO;
                        };
                        name = Release;
                                LLDB_ENERGY_CFLAGS = "";
                                "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
                                LLDB_ENERGY_LFLAGS = "";
-                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-lpmenergy -lpmsample";
                                LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
                                LLDB_ZLIB_LDFLAGS = "-lz";
                                ONLY_ACTIVE_ARCH = YES;
                                "SDKROOT[arch=x86_64h]" = macosx;
                                SKIP_INSTALL = YES;
                                STRIP_INSTALLED_PRODUCT = NO;
-                               USER_HEADER_SEARCH_PATHS = (
-                                       ./source,
-                                       ../../source,
-                                       "$(DERIVED_SOURCES_DIR)",
-                                       ../../include,
-                               );
+                               USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
                                VERSIONING_SYSTEM = "apple-generic";
                                VERSION_INFO_BUILDER = "$(USER)";
                                ZERO_LINK = NO;
                                LLDB_ENERGY_CFLAGS = "";
                                "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
                                LLDB_ENERGY_LFLAGS = "";
-                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-lpmenergy -lpmsample";
                                OTHER_CFLAGS = (
                                        "$(LLDB_COMPRESSION_CFLAGS)",
                                        "$(LLDB_ZLIB_CFLAGS)",
                                "SDKROOT[arch=x86_64]" = macosx;
                                "SDKROOT[arch=x86_64h]" = macosx;
                                SKIP_INSTALL = YES;
-                               USER_HEADER_SEARCH_PATHS = (
-                                       ./source,
-                                       ../../source,
-                                       "$(DERIVED_SOURCES_DIR)",
-                                       ../../include,
-                               );
+                               USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
                                ZERO_LINK = NO;
                        };
                        name = DebugClang;
                                LLDB_ENERGY_CFLAGS = "";
                                "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
                                LLDB_ENERGY_LFLAGS = "";
-                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-lpmenergy -lpmsample";
                                OTHER_CFLAGS = (
                                        "$(LLDB_COMPRESSION_CFLAGS)",
                                        "$(LLDB_ZLIB_CFLAGS)",
                                "SDKROOT[arch=x86_64]" = macosx;
                                "SDKROOT[arch=x86_64h]" = macosx;
                                SKIP_INSTALL = YES;
-                               USER_HEADER_SEARCH_PATHS = (
-                                       ./source,
-                                       ../../source,
-                                       "$(DERIVED_SOURCES_DIR)",
-                                       ../../include,
-                               );
+                               USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
                                ZERO_LINK = NO;
                        };
                        name = Release;
                                LLDB_ENERGY_CFLAGS = "";
                                "LLDB_ENERGY_CFLAGS[sdk=macosx*]" = "-DLLDB_ENERGY";
                                LLDB_ENERGY_LFLAGS = "";
-                               "LLDB_ENERGY_LFLAGS[sdk=macosx*]" = "-weak-lpmenergy -weak-lpmsample";
+                               "LLDB_ENERGY_LFLAGS[sdk=macosx*]" = "-lpmenergy -lpmsample";
                                OTHER_CFLAGS = (
                                        "-Wparentheses",
                                        "$(LLDB_ENERGY_CFLAGS)",
                                SKIP_INSTALL = YES;
                                "SKIP_INSTALL[sdk=iphoneos*]" = NO;
                                STRIP_INSTALLED_PRODUCT = YES;
-                               USER_HEADER_SEARCH_PATHS = (
-                                       ./source,
-                                       ../../source,
-                                       "$(DERIVED_SOURCES_DIR)",
-                                       ../../include,
-                               );
+                               USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
                                ZERO_LINK = NO;
                        };
                        name = BuildAndIntegration;
                                LLDB_ENERGY_CFLAGS = "";
                                "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
                                LLDB_ENERGY_LFLAGS = "";
-                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-lpmenergy -lpmsample";
                                LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
                                LLDB_ZLIB_LDFLAGS = "-lz";
                                OTHER_CFLAGS = (
                                "SDKROOT[arch=x86_64]" = macosx;
                                "SDKROOT[arch=x86_64h]" = macosx;
                                SKIP_INSTALL = YES;
-                               USER_HEADER_SEARCH_PATHS = (
-                                       ./source,
-                                       ../../source,
-                                       "$(DERIVED_SOURCES_DIR)",
-                                       ../../include,
-                               );
+                               USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
                                ZERO_LINK = NO;
                        };
                        name = DebugClang;
                                LLDB_ENERGY_CFLAGS = "";
                                "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
                                LLDB_ENERGY_LFLAGS = "";
-                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-lpmenergy -lpmsample";
                                LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
                                LLDB_ZLIB_LDFLAGS = "-lz";
                                OTHER_CFLAGS = (
                                "SDKROOT[arch=x86_64]" = macosx;
                                "SDKROOT[arch=x86_64h]" = macosx;
                                SKIP_INSTALL = YES;
-                               USER_HEADER_SEARCH_PATHS = (
-                                       ./source,
-                                       ../../source,
-                                       "$(DERIVED_SOURCES_DIR)",
-                                       ../../include,
-                               );
+                               USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
                                ZERO_LINK = NO;
                        };
                        name = DebugPresubmission;
                                LLDB_ENERGY_CFLAGS = "";
                                "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
                                LLDB_ENERGY_LFLAGS = "";
-                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-lpmenergy -lpmsample";
                                OTHER_CFLAGS = (
                                        "-Wparentheses",
                                        "$(LLDB_ENERGY_CFLAGS)",
                                "SDKROOT[arch=x86_64]" = macosx;
                                "SDKROOT[arch=x86_64h]" = macosx;
                                SKIP_INSTALL = YES;
-                               USER_HEADER_SEARCH_PATHS = (
-                                       ./source,
-                                       ../../source,
-                                       "$(DERIVED_SOURCES_DIR)",
-                                       ../../include,
-                               );
+                               USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
                                ZERO_LINK = NO;
                        };
                        name = DebugPresubmission;
                                LLDB_ENERGY_CFLAGS = "";
                                "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
                                LLDB_ENERGY_LFLAGS = "";
-                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-lpmenergy -lpmsample";
                                LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
                                LLDB_ZLIB_LDFLAGS = "-lz";
                                OTHER_CFLAGS = (
                                "SDKROOT[arch=x86_64]" = macosx;
                                "SDKROOT[arch=x86_64h]" = macosx;
                                SKIP_INSTALL = YES;
-                               USER_HEADER_SEARCH_PATHS = (
-                                       ./source,
-                                       ../../source,
-                                       "$(DERIVED_SOURCES_DIR)",
-                                       ../../include,
-                               );
+                               USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
                                ZERO_LINK = NO;
                        };
                        name = "CustomSwift-Debug";
                                LLDB_ENERGY_CFLAGS = "";
                                "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
                                LLDB_ENERGY_LFLAGS = "";
-                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+                               "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-lpmenergy -lpmsample";
                                LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
                                LLDB_ZLIB_LDFLAGS = "-lz";
                                OTHER_CFLAGS = (
                                "SDKROOT[arch=x86_64]" = macosx;
                                "SDKROOT[arch=x86_64h]" = macosx;
                                SKIP_INSTALL = YES;
-                               USER_HEADER_SEARCH_PATHS = (
-                                       ./source,
-                                       ../../source,
-                                       "$(DERIVED_SOURCES_DIR)",
-                                       ../../include,
-                               );
+                               USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
                                ZERO_LINK = NO;
                        };
                        name = "CustomSwift-Release";
index e713275..6eeb248 100644 (file)
@@ -418,11 +418,13 @@ std::string MachTask::GetProfileData(DNBProfileDataScanType scanType) {
       
       profile_data_stream << "phys_footprint:" << phys_footprint << ';';
     }
+      
+    if (scanType & eProfileMemoryCap) {
+      profile_data_stream << "mem_cap:" << memory_cap << ';';
+    }
 
-// proc_pid_rusage pm_sample_task_and_pid pm_energy_impact needs to be tested
-// for weakness in Cab
 #ifdef LLDB_ENERGY
-    if ((scanType & eProfileEnergy) && (pm_sample_task_and_pid != NULL)) {
+    if (scanType & eProfileEnergy) {
       struct rusage_info_v2 info;
       int rc = proc_pid_rusage(pid, RUSAGE_INFO_V2, (rusage_info_t *)&info);
       if (rc == 0) {